Questions tagged [sort]
Sorting text files or other data, for example with the sort utility.
1,034 questions
5
votes
0
answers
132
views
Why does Nautilus sort these files in this order?
In Nautilus (Debian 12, en_US.UTF-8, GNOME Files 43.2), the following eight files are sorted in the following order:
-
-1
--
--1
1
--a
-a
a
To answer the question (Why does Nautilus sort these files ...
1
vote
1
answer
108
views
sort result of fd
I use fd to find file names containing only zeros. I want adopt this code to work with all files in folders, not with the only one file... This works not bad
$ fdfind -tf -x bash -c '[ -s {} ] &&...
4
votes
2
answers
605
views
Unix sort doesn't sort string correctly [duplicate]
Here is my simple test file:
# cat test
grp_pt cmg
grp_pt compsc
grp_pt ffre
grp_pt grp_pt
grp_pt hpcedt
grp_ptix dsnlp
grp_ptix exinspect
grp_ptix ptix
grp_ptix sciml
grp_ptix vers
grp_ptix ...
2
votes
0
answers
86
views
How can I find multiple duplicates of media files,sort, backup them and delete the rest?
I have a 4 TB hard drive containing pictures, sounds, and videos from the last 15 years.
These files were copied onto this drive from various sources, including hard drives, cameras, phones, CD-ROMs, ...
3
votes
1
answer
249
views
How are leading spaces handled in sort -k?
I have a file named test with the following content:
12288
4096
505
Note that there's a single space before 12288, two spaces before 4096 and three spaces before 505.
When I run GNU sort -k1.1,...
5
votes
2
answers
259
views
How to show directory sizes in tree format with correct values and depth control
I can't solve what I want using the tree, du, or df commands.
I'm using:
du version 9.6
tree version 2.2.1
What I want:
For the current directory, list all directories recursively to a depth of 3, ...
0
votes
1
answer
55
views
Sort of different column using different types, works, only strange thing with spaces
I have this file
1 you
3 me
2 their
4 us
this pipe works fine (it order first column by number, second by letters) is a pipe of another user found here
paste <(awk '{print $1}' file.txt | sort ...
9
votes
2
answers
996
views
How do I make `ls` sort the same way Thunar sorts files?
The title is a summary of what I'm trying to achieve, but I'll give an example to illustrate what my problem is and how I've been trying to solve it.
Example folder
Let's say I've got a folder on a ...
0
votes
3
answers
120
views
Searching unique entries in a file
I am using Arch Linux/Debian Linux and want a list of unique "identifiers" in an ASCII txt file. Here is a snippet of the data I want to whittle down:
... (Received from VRW): wind ...
... (...
0
votes
1
answer
46
views
How to sort correctly the processes hungry of ram?
With this cmd line I see processes and use of ram in mb
ps aux | awk '{print $6/1024 " MB\t\t" $11}' | sort -rn|less
The problem is the sort
9.95703 MB /usr/lib/systemd/systemd-...
4
votes
1
answer
115
views
Why does command 'sort' behave differently for those 2 files
Those 2 sequences of lines are not sorted the same by the Linux shell command sort (gnu-coreutils 8.22 under RHEL 7.8), even though they begin with the same distinct prefixes. Why ?
$ echo "f'*.5....
-5
votes
1
answer
73
views
After wrote prompt $ sort [closed]
After I wrote prompt $ sort
display doesn't shown anything what the next step?
1
vote
1
answer
115
views
How can I find duplicate lines among files?
I have a software module which contains some files with same pattern.
<whitespaces>private static final long serialVersionUID = \dL;
How can I find files with the same value?
$ grep -R ...
2
votes
1
answer
540
views
linux sort float numbers starting with point
I would expect that the -g flag tells sort to treat the fields as floating point numbers, but:
cat << EOF | sort -g -k1,2
0 0
0 1.0
0 .5
0 5.0
EOF
gives
0 0
0 1.0
0 .5
0 5.0
Therefore the .5 ...
0
votes
2
answers
244
views
Sort is not sorting?
I seem to be having the same issue as described in The "join" utility reports: file is not sorted, but in fact it is sorted however I have piped BOTH files through sort before attempting to ...