Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [gnu]

GNU Project is a free software, mass collaboration project. The founding goal of the project was, in the words of its initial announcement, to develop "a sufficient body of free software [...] to get along without any software that is not free.

0
votes
1answer
29 views

Are 'kernel-modules' and 'GNU C Library' the same?

I am newbie in Linux and I am trying to understand the basics of the Linux OS structure. So: Are the 'linux-kernel-modules' listed in the output from 'lsmod' and 'GNU C Library' (about 2000 ...
-1
votes
1answer
44 views

Dual Boot Problem

My laptop has Windows 10 installed, I bought a SSD and installed Ubuntu on it. I want to start Ubuntu when the external SSD is plugged in and start Windows 10 otherwise. I tried changing the boot ...
0
votes
1answer
49 views

Why doesn't GNU `su` respect end of options?

When I run user@hostname:~$ su -- root -z I get bash: -z: invalid option Usage: bash [GNU long option] [option] ... ... The above is the behavior I expect. When I run user@hostname:~$ su -l -- ...
0
votes
1answer
19 views

GNU datamash transpose example doesn't seem to work correctly

I am trying to replicate the example of using teh GNU datamash utility to transpose a file. I get a different output though. Not sure what's happening. Instructions: https://www.gnu.org/software/...
1
vote
1answer
63 views

Understanding bash outputs when backgrounded jobs are not found

When I enter the command: a&b I receive the output: [1] 15872 b: command not found a: command not found When I enter the command: a & c My terminal's output is: [2] 15964 c: command not ...
3
votes
0answers
27 views

How can I debug or trace sorting for “LC_COLLATE=en_US.UTF-8 ls -l”?

(Unexpected sort order in en_US.UTF-8 locale explains the basics of UTF sorting) Consider this test scenarion: # touch abc{.{g,t,t.t},@.s,-{s-w,t.c}} # LC_COLLATE="en_US.UTF-8" ls -l test total 0 -...
0
votes
1answer
58 views

how to make my sed command work in GNU works in BSD

I have a block content in my ~/.ssh/config. begin with a line '# BEGIN AUTO GENERATED CONTENT' and end with a line '# END AUTO GENERATED CONTENT' I have a command replacing content between this two ...
0
votes
1answer
28 views

Is loader for a particular “executable format” configurable in Linux?

This question is in continuation of How does compiler lay out code in memory, which is posted at stack-overflow. I have few questions with respect to ld (GNU) utility available in Linux. Whenever ...
-1
votes
2answers
78 views

How to advocate for GNU to add a “--json” parameter for all CLI commands to be compliant? [closed]

Call me a dreamer, but imagine a world where "every" CLI tool we use had an option to produce a stable output, say in JSON. Programmatic use of CLI tools like ls, free, df, fdisk would be a breeze. ...
0
votes
1answer
37 views

./configure checking whether vs checking if

./configure script outputs checking if and checking whether on execution how the two results are different for checking conditions?
0
votes
1answer
56 views

GNU Parallel facing silent exit and invalid option error

I tried performing the full installation from: http://git.savannah.gnu.org/cgit/parallel.git/tree/README The installation was successful. It's working well when installed on Mac OS but on Amazon ...
7
votes
1answer
228 views

Newlines in BSD sed vs gsed

The sed, which comes with FreeBSD 11.2 p7, gives: $ seq 10 | sed 'N; l; D; p' 1$ 2$ 2$ 3$ 3$ 4$ 4$ 5$ 5$ 6$ 6$ 7$ 7$ 8$ 8$ 9$ 9$ 10$ While gsed (GNU sed 4.7) gives for the same script: $ seq 10 | ...
0
votes
2answers
90 views

Are there multiple flavors of the GNU tools?

I think that the BSD tools have different flavors, for example the BSD ls tool is not the same tool on FreeBSD and OpenBSD and NetBSD (and even on macOS). Note that by "different flavors" I mean that ...
1
vote
1answer
94 views

Repeat print of a pattern repeated n times in one line with sed

With a sed cmd I want to print all occurrences of a pattern in one line. I know how to do this with grep -Pe and with awk. I started with: $ sed 's/^.*label="\(.*\)" selected.*$/\1/g' <(echo '...
1
vote
1answer
94 views

Does Apple modify the GNU and BSD tools that comes with macOS? [duplicate]

macOS comes with bash (which is a GNU tool), macOS also comes with tools like ls and chmod (which are BSD tools, even though I don't know from which BSD flavor they come from). Now does the GNU and ...
3
votes
3answers
521 views

insert EOF statement before the last line of file

I want to insert this cat <<EOF >> /etc/security/limits.conf * soft nproc 65535 * hard nproc 65535 * soft nofile 65535 * hard ...
1
vote
0answers
20 views

GNU Linker Colorization

Compiling code with GCC or Clang can result in some colorful error outputs. Linking code, however, doesn't enjoy the same luxury. It seems like the GNU Linker doesn't support colorized error output ...
1
vote
3answers
200 views

grep everything up until and including a pattern

Let's assume I have a log file that contains exceptions as shown java.lang.NullPointerException blabla ABC.Exception blalabbla dogchacecat.Exception yadayada I want to be able to output each line ...
15
votes
5answers
2k views

Subtract time using date and bash

All the other questions on the SE network deal with scenarios where either the date is assumed to be now (Q) or where only a date is specified (Q). What I want to do is supply a date and time, and ...
2
votes
1answer
43 views

Add (true || … ) to a function using sed

I quickly want to patch a huge library by adding true || in front of every function call. Example input: if function_a(some_parameters) && function_b would turn into if (true || function_a(...
0
votes
2answers
192 views

How can sed replace in the range of nth line regex specified?

I am to replace using sed the 3th (or nth to be more general) occurrence in respective line with specified match regex. so far as i can is only to do the first: $cat file # Golden dictionary is a ...
6
votes
1answer
394 views

Any way to have a “verbose mode” or “debug mode” with sed?

Is there a way to make gnu sed be verbose about what is run and what is done ? I'd like to have something like a "debug mode" so that I can see - for each line of input - the content of the hold space ...
6
votes
7answers
572 views

How to avoid printing a newline when seq completes?

To create a column header, looking like: 1234567890123456789 I (am trying to) use seq and echo: seq -s '' 1 9 ; echo -n 0; seq -s '' 1 9 However, seq outputs a newline after each run. How can I ...
0
votes
0answers
37 views

Why doesn't Guile have /usr/local in path?

I've noticed when compiling and installing modules for Guile in /usr/local that they cannot be found, while setting the prefix to /usr they work as intended. Is there a reason why Guile doesn't have /...
1
vote
1answer
53 views

what used to lead /bin being full and creation of /usr/bin?

I am and was reading https://lwn.net/Articles/773342/ where the current move of migrating whole lot of filesystem from /usr/$something to simply /usr . Some of the comments again and again comment on ...
0
votes
2answers
136 views

Gnu Sed: Space Character class not matching for end of line character

Pattern: abc followed by space or is the last character in a line. orig="abc[[:space:]]+"; new=Hello sed -i -r -e "s|${orig}|${new}|g" ./file ; File: abc abcd abc abc d After executing: abc abcd ...
-1
votes
1answer
205 views

Bash Conditional String and Integer together

I am trying to do both integer and string comparison in a statement as follows: $ TimeHr=$(date +%_H) $ Time=Night $ echo TimeHr 1 $ if ((TimeHr>18 || TimeHr<5 )) && [ Time == "Night" ]...
1
vote
2answers
172 views

Awk or Sed: If pattern is found: delete line && export variable

In my bashscript I want Sed to find debug: Debug in a file ${SourceP} and if found delete that line and export to the environment Debug=Debug sed -i '/debug: Debug/,+0 d' ${SourceP} && export ...
1
vote
1answer
48 views

Why does `xargs -n ` on SmartOS (SunOS) behave differently than other implementations?

It seems the -n option on the xargs found in SmartOS (and I assume Solaris) does not behave like any other version of xargs I've encountered. Take this example: Builtin /usr/bin/xargs (odd behavoir):...
0
votes
1answer
86 views

Array inside an Array: Different syntax for Array in bash

I found the following example from here. But I can't understand how is array arr is being defined. a='domain.de;de;https' $ arr=(${a//;/ }) What is the advantage of defining it like this? Actually, ...
0
votes
1answer
65 views

What is the predefined order in which man searches sections? [duplicate]

The description of man in its own man page contains the statement, The default action is to search in all of the available sections following a pre-defined order ("1 n l 8 3 0 2 5 4 ...
1
vote
1answer
173 views

GNU coreutils and GNU Bash [closed]

I confused with GNU coreutils and GNU Bash, I have installed Bash GNU Project - Free Software Foundation, Should I install Coreutils - GNU core utilities How could I distinguish them?
0
votes
0answers
45 views

Update Reference to GNU/Bash manual in place on Macos

I installed GNU/bash on MacOs and set it as default: $ bash --version GNU bash, version 4.4.23(1)-release (x86_64-apple-darwin18.0.0) Copyright (C) 2016 Free Software Foundation, Inc. License GPLv3+: ...
0
votes
0answers
277 views

My Debian install gives me black screen on start up - it's a quick fix but it happens every time

My issue is a bit strange. I am running Debian GNU/Linux Testing Buster, and I'm very happy with it. However, it has one minor but persistent issue that I can't seem to figure out. Each and every time ...
4
votes
2answers
859 views

Makefile and .ONESHELL

When .ONESHELL is not used Makefile executes each shell commands in a separate shell. What is the benefit of this? Why doesn't makefile uses the same shell?
0
votes
1answer
51 views

GNU coreutils need suggestions [closed]

Can anyone please suggest me some book or website from where I can learn about gnu coreutils to get more knowledge about terminal commands. An interactive book or website would be a nice start.
0
votes
2answers
848 views

Difference between find and GNU find

Consider some common *nix systems (say Debian, CentOS, Arch and Kali). I always used find; I don't recall using GNU find, but from one example I've seen I assumed the syntax of GNU find might be ...
1
vote
2answers
72 views

Find a list of files that contains a set of consecutive lines defined in another file

I have a Reference file that contains a b c d I have to check all files in a subfolder recursively that contains all the lines of Reference file consecutively and delete those files. For example, ...
2
votes
0answers
97 views

Ulimit not respected in GNU bash OSX

I am seeing a strange issue with gnu bash in OSX. The value of ulimit -f is being changed by the bash itself. Small reproducible code: #!/usr/local/bin/bash ulimit -f 1 echo "Value: $(ulimit -f)" ...
0
votes
2answers
339 views

Sed with Character class [^[:space:]] not getting recognized

I used following sed with character class [^[:space:]] as follows: orig="(\`\`\`)([^[:space:]]*)"; new="\1{.\2 .numberLines startFrom=\"1\" .lineAnchors}"; sed -i -r -e "s|${orig}|${new}|g" ${...
1
vote
1answer
431 views

Makefile: Copy using make variables --> error; Not so without variables!

In the following makefile InputLocation:=./Test OutputLocation:=$(InputLocation)/Output Input:=$(wildcard $(InputLocation)/*.md) Output:=$(patsubst $(InputLocation)/%, $(OutputLocation)/%, $(Input:...
0
votes
1answer
29 views

Pass a Make variable to Bashscript that is invoked from inside Make

In a pattern rule I would like to export make variable like $(TargetLocation), $@. I tried the following but It didn't get exported. The bash script is executable. export $(TargetLocation); \ export ...
2
votes
3answers
90 views

Find command that excludes paths listed in a file

I need to exclude a bunch of paths from a find command. For example: find "$(pwd)" -not \( \ -path "*/.git"\ -o -path "*/.git/*"\ -o -path "*/.vscode"\ -o -path "*/.vscode/*"\ -o -path "*/...
0
votes
3answers
60 views

How to search for a match, then a non-match on that line, but include context lines for matched line?

Say I have a file containing: ⟫ cat schema.rb create_table "things", id: :serial, force: :cascade do |t| t.string "other_column" # ... t.datetime "created_at" end create_table "...
2
votes
2answers
301 views

Are there any successful forks or refactors of the Linux Kernel?

A google search reveals this slashdot story yielding this github repository that hasn't had a commit since 2016. There are 22,602 forks listed on github.com but these are going to be mostly (if not ...
0
votes
1answer
36 views

Can chmod on a directory without --recursive change who can read a file within that directory? [duplicate]

Based on the suggested duplicate, let me reformulate my question: If chmod 0660 path/to/folder is run, and user A isn't in the relevant group, could user A still read /path/to/folder/file.txt if that ...
1
vote
1answer
612 views

Why is ddrescue slow when it could be faster on error free areas?

This question addresses the first pass of ddrescue on the device to be rescued. I had to rescue a 1.5TB hard disk. The command I used is: # ddrescue /dev/sdc1 my-part-img my-part-map When the ...
-5
votes
2answers
210 views

Signal the end of option arguments: double dashes `--` vs single dash `-`? [duplicate]

I notice in https://unix.stackexchange.com/a/459007/674, that single dash - is used to signal the end of option arguments. Is it correct that double dashes -- can also signal the end of option ...
1
vote
1answer
239 views

Is sort -k1,2 equivalent to sort -k1,1 -k2,2?

I'm experimenting with GNU sort and LC_COLLATE="en_US.UTF-8". I have a file called 'test': 1,0 1 10 2 1,0 3 10 4 With sort -k1,2 as well as with simple sort test the order doesn't change: $ sort -...
0
votes
0answers
26 views

Changing a partition size without affecting the booting

I have Kali linux installed with dd on a couple of drives, they all have live persistence enabled with one acting as LUKS encrypted one (sdb3) (the one I'm using) and the other one is without ...