May 2018
Beginner
332 pages
7h 28m
English
This command sorts the contents of a text file, line by line. The options are as follows:
| Sr | Examples of command usage | Explanation |
| 1 | sort sample.txt | Alphabetically sorts the lines |
| 2 | sort -u sample.txt | Duplicate entries are sorted |
| 3 | sort -r sample.txt | Reverse sort |
| 4 | sort -n -k3 sample.txt | Numerical sort of the third field |