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.

learn more… | top users | synonyms

7
votes
4answers
3k views

Nautilus sorts the Name-column “mysteriously”. How can I change the collating sequence?

What I describe here is not about a problem with my Nautilus. (it is the default behavour) I understand why Nautilus sorts the Name-column (ascending) so that "6 cats" occuring before "10 dogs"... ...
6
votes
6answers
20k views

Identify duplicate lines in a file without deleting them?

I have my references as a text file with a long list of entries and each has two (or more) fields. The first column is the reference's url; the second column is the title which may vary a bit ...
3
votes
2answers
14k views

How to sort lines in a text file from the terminal?

I have to sort the GPA in a file for my class lab. The teacher uses putty, for those of us that chose to use Ubuntu in the class, we have no idea how to do the command for ascending sort and ...
9
votes
3answers
7k views

Can I view my files sorted by date?

Can I view my files sorted by date? I want to see my files sorted by date, I mean the first one the newest. I didn't find this option. Thanks in advance.
13
votes
8answers
7k views

How do I sort by human readable sizes numerically?

for example I have command that shows how much space folder takes du folder | sort -n it works great, however I would like to have human readable form du -h folder however if I do that than I ...
5
votes
1answer
2k views

How do I force folder view sort order to not ignore special characters?

I have many folders in my home directory that have names that begin with special characters such as _OLD_500GB_HD or !FolderIWantToSeeAtTheTop, but for some reason these folders are sorted according ...
13
votes
2answers
811 views

Wrong behavior of sort command?

I tried to sort the content of a file in Ubuntu desktop 14.04 (Trusty Tahr). In my case, the expected result should be same as original content, but the actual result is not. Why? # cat test.txt a++-...