Questions tagged [sort]
Sort is a command-line program that allows standard input or specified text files to be sorted in various ways such as numerically or alphabetically, and then the result can be displayed in the terminal or sent to file.
134 questions
3
votes
0
answers
36
views
How to make ls sort order case insensitve in Ubuntu 25.10? [duplicate]
I'm using Ubuntu 25.10.
How do you make ls sort order case insensitive? For example, when I do "ls -l", I get this:
$ ls -l
total 24
drwxrwxr-x 2 menmonic mnemonic 4096 Oct 19 09:13 Apples
...
19
votes
1
answer
3k
views
"sort" command ignores locale rules for capitalization, accentuation and special characters in 25.10
When I type the following in a command line:
sort
à
b
C
d
_e
followed by Ctrl-D I get this result:
C
_e
b
d
à
When I type locale in the same command line I see that LC_COLLATE is fr_FR.UTF-8. sort ...
1
vote
0
answers
99
views
How to sort file name lexicographic in Files?
Ubuntu 24.04. Files sorting by name shows
2025-09-16.pdf
202409.pdf
202410.pdf
In terminal, ls -l shows
202409.pdf
202410.pdf
2025-09-16.pdf
How can I change so Files sorts the same way as ls -l?
1
vote
0
answers
62
views
Desktop file sorting headache
I use Double Commander as my file manager for my desktop. It sorts my audio equipment files like this:
AU-217.jpg
AU-2900.jpg
AU-666.jpg
This is also what I get when I do ls -l in a terminal window. ...
1
vote
1
answer
1k
views
how to sort the application list
I'm using Ubuntu 24.04 and when I press on the 'show apps' button the display shows me a alphabetically unsorted list of applications. Is there a way to sort this list?
I've tried the command:
...
-1
votes
1
answer
693
views
How to obtain a list of all the files recursively without listing the directories to which the files belong and sort the list of files alphabetically? [duplicate]
I only managed to list the directories themselves with ls -a or the files sorted by directory with ls -aR
0
votes
3
answers
290
views
sort in shell using multiple -t
I have a file that contains:
192.168.130.175 2014-09-04 10:25:01 /index.html
192.168.138.244 2014-09-04 11:23:00 /index.html
192.168.138.244 2014-09-04 10:29:37 /...
0
votes
3
answers
168
views
Help finding files with the same filename (except what's inside parenthesis) and deleting the smaller size ones
I need to know how to find one or more files with the same filename (except what's inside parenthesis) and delete the one(s) with the smaller size, in a folder. I don't care if it's a GUI app or ...
1
vote
1
answer
143
views
Sorting a text file based on numerical values present in each line
I have a text file containing paths of various wav files. But when they are created they are sorted based on alphabetical order. Hence the paths are like this
/home/wav_path/...
3
votes
1
answer
635
views
Bash sort lines starting with punctuation in non-dictionary order
I have a file containing lines, some of which start with a ! character, some with a ? character, and some with a space ( ) character. The second character is always a letter of the alphabet.
When I ...
0
votes
1
answer
514
views
What files need to be copied into Ubuntu docker image to support da_DK.UFT-8 locale?
We have a docker image which runs Newman queries against a backend to verify things are as expected. Now we have a new need to test that a response containing Danish characters is sorted correctly in ...
0
votes
1
answer
919
views
How to use last to see how many times users logged in?
I need to see how many times users logged in.
I used last | sort | uniq -c but it gave me bad data
I need to sort them by number of times they logged in and only show username and number of time.
for ...
0
votes
0
answers
429
views
Tail in combination with sort
I use tail in a variable to echo contents of multiple files in a folder.
VAR="$(tail -n +1 DIR/*/file)"
This outputs all the files contents with the needed filename on top like
==> /...
6
votes
1
answer
1k
views
How to sort by year-month-day from ascending using the "sort" command?
I want to sort dates in the format 31.12.2023. Lowest year should be displayed first then lowest month then lowest day.
Is the following code fitting my needs? Seems good on first look.
sort -t '.' -k ...
1
vote
0
answers
222
views
Case insensitive sort in Nemo
So I'm trying to get so special characters are on top followed by numbers, then letters case insensitive.
I've added export LC_ALL=C to my .profile, but the result is case sensitive.
Is there a better ...