Stack Exchange Network

Stack Exchange network consists of 174 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.

4
votes
2answers
211 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
39 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.
4
votes
1answer
507 views

find VS GNU find

Consider some common *nix systems (say Debian, Ubuntu, Fedora, CentOS, Arch and Kali). I use Linux since 2014 but always used find. I don't recall personally using GNU find, but from one example I've ...
1
vote
2answers
68 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
32 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
24 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" ${...
0
votes
1answer
19 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
25 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
75 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
28 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
163 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
34 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
132 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
71 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
61 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
20 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 ...
0
votes
2answers
51 views

Split file into 4 chunks using macOS version of split package

In GNU/Linux in order to split file into 4 equal chunks we can do something like: split temp -n 4 PREFIX_ But seems like the macOS' BSD version of split utility doesn't have -n option. What would be ...
0
votes
0answers
15 views

Prepend or append to substrings while expanding associative array in GNU Bash

This question was partly inspired by http://mywiki.wooledge.org/BashFAQ/073 , although that page is currently about indexed arrays rather than associative arrays. GNU Bash provides a syntax that ...
4
votes
1answer
107 views

Safely define an environment variable

AFAICT, neither GNU Bash, nor any other relevant package (e.g. GNU coreutils) that is commonly available in GNU/Linux distros, has a ready-made way to define an environment variable such that the ...
2
votes
1answer
67 views

Where is “gcc_tooldir”

Under Cross-Compiler-Specific Options, it says: The default value, in case --with-sysroot is not given an argument, is ${gcc_tooldir}/sys-root. but it appears that gcc_tooldir is not defined. Is ...
4
votes
3answers
321 views

How can I partially serialize with GNU make

When I have a make task where a specific target needs to be made before another, while in parallel mode, this is simple when using SunPro Make (dmake). The following makefile: install: dir dir/file ...
1
vote
1answer
145 views

GNU Pattern Match and replace exact number of characters

This question may have been listed but I was not able to find one exact hit. I am trying to skim through a file, match a pattern and replace it with something else. However there are other ...
3
votes
0answers
61 views

Why BSD grep is not returning all the results, but GNU does? [duplicate]

Given the file with numbers from 1 to 100 (seq 1 100 > dataset.txt), and the pattern file with numbers from 1 to 20 (seq 1 20 > patterns.txt), I would like to to print all exact matches from ...
0
votes
0answers
34 views

Solar time in gcal (GNU calendar)

How to display solar time (real time, sundial time) in gcal? gcal has option -c which displays fixed date events from ~/.gcalrc where you can use % macros. There are several astronomical macros ...
0
votes
0answers
3k views

GNU Samba server: check SMB version of exported and mounted shares

I have a NAS Zyxel NAS326 running on Linux acting as Samba server. I can't exactly say which Linux distribution, this is all I get from "uname -a": root@nas326:~# uname -a Linux nas326 3.10.39 #1 Fri ...
0
votes
2answers
50 views

What's $(MAKE) or ${MAKE} actually supposed to mean in make scripting language

What's $(MAKE) or ${MAKE} actually performing in entire make building process. is it invoking a process which is similar to sub-routine i.e. in simplest terms 'call a function', or is it starting a ...
5
votes
1answer
123 views

Problem using xargs --max-args --replace with default delimiter

This works as expected: $ echo a b c | xargs --replace="{}" echo x "{}" y x a b c y This does too: $ echo a b c | xargs --max-args=1 echo x x a x b x c But this doesn't work as expected: $ echo a ...
1
vote
1answer
97 views

Are Unix's extended regex compatible?

Are Unix's tool regex fully compatible ? For instance, if I grep -oE "\$text *\( *([^)]) *\)", am I garanteed to replace the exact portion I got if I use sed -E "s/\$text *\( *([^)]) *\)/replacement/...
1
vote
1answer
63 views

Does the search tracking and Amazon information sharing attributed to Ubuntu part of Debian?

I understand from Richard Stallman in this video, made probably in 2012/2013, that Ubuntu isn't 100% free by the GNU organization definition of Free Software, as according to Stallman there, it "spies"...
0
votes
1answer
199 views

A strange problem when trying to install GNU MPFR

I'm trying to install GNU MPFR. I've downloaded the source, cd'd into it and typed ./configure, which goes through a load of checks (which are all okay, as far as I can see.) The problem occurs when ...
3
votes
1answer
281 views

How do I prevent gpg from including SHA1?

apt-get is complaining that signatures are invalid and that the InRelease file is not signed (see Using Centos to sign .deb packages for background). On the server, I have verified using gpg that ...
-3
votes
2answers
87 views

Is tty like a OS without DE?

Can I use tty to call Media Player and watch a video? Or run a browser in it? Since tty is just a virtual terminal.
1
vote
1answer
106 views

Freebsd 11.1 issues with gnu m4 eval test fail

I am pretty new Freebsd user. As I am trying to install gnu m4-1.4.18, I get eval fail on eval test section: Checking ./189.eval @ ../doc/m4.texi:6405: Origin of test ./189.eval: stdout mismatch --- ...
-1
votes
1answer
488 views

What does exactly does GNU make dep do?

I am trying to understand GNU Make and trying to understand some c code and GNU autotools. There's a folder let's say lib, with three subfolders and a makefile. lib ...libA ...---compile.sh ...---...
24
votes
1answer
2k views

Since when do the POSIX and GNU rm not delete /?

For several years now, the GNU rm utility won't delete / unless it is called with the --no-preserve-root option. However, the command rm -rf / has been lodged in the collective subconscious as ...
1
vote
0answers
30 views

macOS (BSD) vs GNU grep multiple pattern inconsistency [duplicate]

I am on macOS Sierra 10.12.6 $ grep --version grep (BSD grep) 2.5.1-FreeBSD $ ggrep --version ggrep (GNU grep) 3.1 Packaged by Homebrew Copyright (C) 2017 Free Software Foundation, Inc. License ...
4
votes
0answers
105 views

How can I add core GNU commands to a pre-existing AIX system?

In another thread (What's the easiest way to sort a list like this) someone asked if we had "GNU ls" on the system because it would provide a solution. We do NOT have GNU ls installed but it got ...
1
vote
1answer
72 views

bsdtar: How to avoid overwriting existing file info?

bsdtar has a -k (Do not overwrite existing files) option, which avoids changing the contents of any existing files, but it still overwrites the file info (e.g. permissions) with what is in the archive....
2
votes
0answers
324 views

With bsdtar “--exclude”, how to only exclude subdirectories?

In GNU tar (i.e. gtar), the --exclude option with a glob only matches the subdirectories, but not the directory itself. For example, --exclude test-tar/a/b/* would exclude anything inside of b, but ...
13
votes
1answer
3k views

gpg —list-keys command outputs uid [ unknown ] after importing private key onto a clean install

I did a clean install of Arch Linux and imported my backed up gpg private key. As a sanity check I ran: gpg —list-keys Everything showed up as normal except for the uid which now reads: uid [ ...
1
vote
2answers
118 views

Use parallel to split many directories into subdirectories or parallelize this task

I want to parallelize spliting of many directories into subdirectories using parallel or using another tool or method. E.g. I have 1 000 000 directories with content, but it's too much for one ...
1
vote
0answers
333 views

What is the difference between dd_rescue and ddrescue, when to prefer which one?

There are two similar tools for a dd on bad hardware: Kurt Garloff's dd_rescue GNU ddrescue What is the difference between dd_rescue and ddrescue, when to prefer which one?
0
votes
0answers
35 views

GNU IceCat and CAcert root certificate

Wikipedia about GNU IceCat: In version 3.0.2-g1, the certificate of CAcert.org, a certificate authority, has been added to the list of trusted root certificates. Concern about that decision has ...
3
votes
1answer
64 views

Use parallel to split many directories into subdirectories

I want to use parallel to split many directories into subdirectories. E.g. I have 1 000 000 directories with content, but it's too much for one directory, so I want to create 10 dirs in the main dir ...
1
vote
2answers
1k views

What is maximum number of files you can store in a tar archive under Solaris 11?

I need to store a large number of files (> 100,000) in a tar archive and have run into the error: /bin/sh: /bin/tar: cannot execute [Arg list too long]. Are there limits with UNIX Solaris tar or GNU ...
2
votes
1answer
38 views

How to make appends to files fail if the file does not exist already?

For example echo Something >> SomeFile I want this append to work only if SomeFile exists already. Right now I am using the following: if [ -e SomeFile ]; then echo Something >>...
1
vote
1answer
43 views

Recursively replace all links with actual files (gnu)

In order to run Code dx on Linux files, I need to replace all links with the actual files. Haven't worked in Linux in years and am getting confused by terminology. Been searching for answers for two ...
0
votes
2answers
837 views

BSD sed vs. GNU sed, and -i

Unix iMac shell terminal sed -i 's/original/new/g' maths.tx Message returned: sed: -i may not be used with stdin
-4
votes
1answer
63 views

What are the GNU programs that I need with Linux if I only edit files? [closed]

What are the minimum number of programs that someone can use to edit files with the Linux kernel? I mean reading a file from some storage device, changing it, and storing it. Maybe by specifying the ...
2
votes
2answers
474 views

How can I run GNU parallel in record per job, with 1 process per core

What I'm really trying to do is run X number of jobs, with X amount in parallel for testing an API race condition. I've come up with this echo {1..10} | xargs -n1 | parallel -m 'echo "{}"'; which ...