OnCallReady

Commands

sort - sort lines of text files

sort [-n] [-r] [-h] [-u] [-k N] [-t SEP] [file]...

Options you will use

-n, --numeric-sort
Compare as numbers.
-h, --human-numeric-sort
Compare human sizes: 2K < 1M < 1G. Pairs with du -h.
-r, --reverse
Reverse the result.
-u, --unique
Output only the first of an equal run.
-k N[,M]
Sort on field N (through M).
-t SEP
Use SEP as the field separator.
-g, --general-numeric-sort
Compare as floating point numbers (1e3, 0.5).
-o, --output FILE
Write the result to FILE instead of stdout. Safe even when FILE is also the input.
-t, --field-separator SEP
Use SEP instead of blanks to split fields: -t: -t,
-k, --key KEYDEF
Sort by a key: -k2 from field 2 to the end, -k2,2 only field 2, -k2,2nr numeric and reversed for that key.

Taught in

Try sort in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.