Команда sort
Sorts the lines in a text file.
sort [-b] [-d] [-f] [-i] [-m] [-M] [-n] [-r] [-u] [+fields] filename [-o outputfile]
| -b | Ignores spaces at beginning of the line. |
| -d | Uses dictionary sort order and ignores the punctuation. |
| -f | Ignores caps |
| -i | Ignores nonprinting control characters. |
| -m | Merges two or more input files into one sorted output. |
| -M | Treats the first three letters in the line as a month (such as may.) |
| -n | Sorts by the beginning of the number at the beginning of the line. |
| -r | Sorts in reverse order |
| -u | If line is duplicated only display once |
| +fields | Sorts by fields , usually by tabs |
| filename | The name of the file that needs to be sorted. |
| -o outputfile | Sends the sorted output to a file. |
sort -r file.txt - Would sort the file, file.txt in reverse order.