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 [coreutils]

GNU Core Utilities (coreutils) is a set of basic Unix command-line utilities

2
votes
1answer
150 views

Why does ls wrap some filenames in single quotes?

I've noticed that when I do ls in a terminal, some filenames are wrapped in single quotes and some aren't. I don't like the way this looks as I prefer my terminal outputs to be nice and uniform. ...
0
votes
0answers
16 views

wingnu32 env tool does not print variable

I found the tip to use the wingnu32 tool env from , which is installed on my Windows 10 device anyway, as Git and Docker are installed. However, I don't get it working as wished. It behaves as ...
0
votes
2answers
38 views

How to sort a list of numbers and null values in ascending order, with null values at the end?

I have a list of numbers and null values. How can I sort them in a way such that the null values come to the end of the list using sort in GNU coreutils? Sample Input (input.data) 0.9000 23 1 2 5 -...
1
vote
0answers
78 views

ls command not working in the home directory

The ls command works fine for me in all other directories except my home directory, where I get the following error: * Exit with code 1, no result found, command line was:?? locate -b -i [\^g]*g[\^a]*...
0
votes
2answers
258 views

ls *.pdf complains: ls: invalid option — '_'

I'm used to using 'ls' as I would in Linux Mint, e.g. 'ls *.pdf', but in this Debian variant 'ls .pdf' complains. I find myself using a length 'find -maxdepth 1 -type f -name ".pdf" -print' instead. ...
4
votes
3answers
68 views

How to compare two files and output lines which do not appear in the first?

If I have a file A containing a list of fields: 2017-04-23 2017-04-30 2017-05-07 2017-05-14 2017-05-21 2017-05-28 2017-06-04 2017-06-11 2017-06-18 2017-06-25 And another file B containing a list of ...
0
votes
1answer
31 views

df hide ifree etc (GNU)

(analogous to https://apple.stackexchange.com/questions/263437/df-hide-ifree-iused-512-blocks-customize-column-format-dont-show-inode-info for BSD) How can I hide the columns beginning with i (iused, ...
1
vote
1answer
208 views

Device names in MSYS2 dd

Which is the equivalent of: dd if=/dev/sda ... dd if=/dev/sda1 ... for dd.exe in MSYS2 in coreutils Does Chrysocome syntax apply?
-3
votes
1answer
89 views

linux ls show seconds for recent files only

linux coreutils ls command shows when using with "-l" option timestamps including hours and minutes for recent files and shows year instead for files older than six months and newer than now. I would ...
0
votes
1answer
481 views

Trying to install coreutils via MacPorts: “Error: Port coreutils not found”

I'm trying to use MacPorts to install coreutils. I check that MacPorts was installed correctly, $ port version Version: 2.3.4 and try to install coreutils, $ sudo port install coreutils Error: ...
1
vote
1answer
89 views

Alternative to ls to group extensions before sorting

I'm looking for some way to modify/replace ls with a command that is capable of: Grouping directories first (as ls does) grouping files by user-defined extension groups (e.g., all image-type ...
1
vote
1answer
737 views

Displaying unicode emoji in filenames on Ubuntu

I'd like to use emoji in filenames and access them on the command line, but I can't seem to get it to work with ls. Weird thing is, if I pipe into just about any other program, the emoji are correctly ...
5
votes
1answer
4k views

more recent build of GNU coreutils for win32?

Is there a more recent build of unxutils.zip? (The unix command-line utilities for Windows) The canonical downloads are at http://unxutils.sourceforge.net/ but they date from 1999-2003; in particular ...
2
votes
1answer
441 views

In what order does GNU env print environment variables?

When invoked without arguments, the env and printenv commands from the GNU Coreutils print the value of every environment variable. What determines the order in which these variables are printed? It'...
2
votes
1answer
38 views

How can I safely remove timeout from a script?

I started a script with timeout --signal 2 --kill-after 10 14400 and now decided that it should rather run as long as it must, so I need to remove that timeout from the running script. top -p $(...
3
votes
2answers
455 views

find: missing argument to `-exec' when using + form of find

I want to execute a command on the paths found with the find command and I want to use + to reduce the number of times the external command is launched. Critically, the command has a fixed value ...
1
vote
1answer
51 views

How to make sort consider blanks (GNU coreutils)

How can I make sort consider blanks? Original file: n c n b n a What I get with sort file is this: n a n b n c So how can I come to this order: n b n c n a Version: sort (GNU ...
0
votes
2answers
118 views

GNU sort file names with prefix and one or two digit

I would like to use GNU sort to have the file names from a find command sorted by the numbers in the name. The name of the file is "cycle" then the first number to sort by, then ".subset", then the ...
12
votes
2answers
514 views

Can a file system's logical structure (including symlink targets) be represented in a single lightweight file (non-binary)?

After playing with multiple SQL and NoSQL databases over the years I feel the best way for me to ensure portability in my personal apps that are data-centric is to avoid all bonafide databases ...
4
votes
3answers
7k views

/usr/bin/realpath not found in Centos 6.5

I'm trying to type 'realpath' in CentOS 6.5. But it seems not installed. I checked it is contained in coreutils (archlinux). I double check the coreutils package which provide by CentOS, it lack the /...
0
votes
2answers
2k views

Unable to get ls to recognise LS_OPTIONS or LS_COLORS?

Trying to get --color=auto as the default ls argument. $ ls --version ls (GNU coreutils) 8.21 … $ echo $LS_COLORS no=00:fi=00:di=00;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=...
9
votes
3answers
2k views

How does `wc -l` work?

I have to read a large file and before I start reading it, I need to know the total number of lines in the file (which are in millions). I have implemented a lot of solutions and have found one. But ...
9
votes
1answer
4k views

`locate` wildcard strange behavior - why?

locate "*.png" returns all files ending with .png, as expected. locate "test.*" doesn't return anything, but there are files named test in my system. locate "*test" returns all files ending with ...
2
votes
1answer
135 views

What does GNU tar “--restrict” option actually restrict?

The manual of GNU tar only states that --restrict: --restrict disable use of some potentially harmful options Can anyone elaborate on what are these "harmful" options? I could not find ...
19
votes
2answers
6k views

Why is xargs necessary?

Suppose I want to remove all files in a directory except for one named "notes.txt". I would do this with the pipeline, ls | grep -v "notes.txt" | xargs rm. Why do I need xargs if the output of the ...
0
votes
1answer
51 views

Why does “head -3” give the same results as “head -n 3”?

I'm interested in why head works as it works with given parameters, i.e. head -3 produces the same output as head -n 3?
9
votes
1answer
9k views

Linux: ls -l prints only question marks:

I have a problem with listing of some directory with ls -l: $ ls -l ./directory -????????? ? ? ? ? ? file001.txt -????????? ? ? ? ? ? file002.txt and just ls works good: $ ls ....
1
vote
1answer
170 views

Recursively searching for specific text inside specific files but only in specific folders

I have a nested folder structure containing lots of folders and files. How do I search inside files for a pattern eg "sampletext", but only if the filename matches a pattern (eg only search inside ...
4
votes
4answers
6k views

Where is the information retreived by “uname” stored?

Uname utility in *nix retrieves wonderful meta information about the machine. Where is this information stored?
0
votes
3answers
1k views

df -h showing wrong output in GB

If I list df output for KB, MB and GB, they do not match e.g. $ df -k |grep xvdb /dev/xvdb1 12796048 732812 11413172 7% /xxx $ df -m |grep xvdb /dev/xvdb1 12497 ...
9
votes
3answers
21k views

Display filesystem's free space available to the root user

By default, Linux reserves some fraction of a filesystem for the root user, at least on ext4 (to prevent ordinary users from filling the drive completely and crashing the system, and to reduce ...
0
votes
1answer
387 views

gnu coreutils split verbose flushed?

When using the GNU coreutils split command with verbose mode, how can I make the lines that appear in the STDOUT be flushed with respect to the time when the file has finally been created? Fore ...
1
vote
1answer
459 views

using coreutils split file into pieces to different directories?

How can I use GNU's coreutils split command to split a large file into pieces of L number of lines each, but putting each of the different subfiles into different directories at the same time they are ...
2
votes
1answer
87 views

Prompt a user and wait for response

In GNUwin32 or UnxUtils, is there a way to prompt a user to "Press enter to continue" and wait for the enter key, such as the unix 'read' command. I used to have an old command 'ask' that would do ...
26
votes
2answers
5k views

What is /usr/bin/[ and how do I use it?

I was looking at coreutils and found this as one of the files included as part of coreutils: /usr/bin/[. What is [ and what does it do? It is an executable. I just don't know what it does or how to ...
1
vote
2answers
2k views

How can I have ls follow the content of a directory like tail -f does on a file

I want to basically continuously update the file list of a directory similar to how tail does with the -f flag on a file. is there any reasonable way to do this?
13
votes
1answer
4k views

How can I install a more modern version of GNU utils (coreutils) on Debian Linux with no admin rights?

I would like to install a more modern version of GNU utils (coreutils) on a debian linux system where I have no admin rights. Is there a way to do that? The rationale is that I need a more modern ...