hide random home http://www.fmi.uni-passau.de/archive/doc/unix/unixhelp/Unixhelp/utilities2_sort7.1.html (Einblicke ins Internet, 10/1995)

Examples of changing the sort order

Examples of changing the sort order

1. To sort a file in dictionary order:

   sort -d +1 -2names > orders

Lines in the file names are sorted on field 2 into dictionary order and the result placed in the file orders.

2. To sort a file in month order:

   sort -M +2 -3 -o breakdown orders

Lines in the file orders are sorted on field3 into month order and the result placed in the file breakdown.