2 Minutes To Code (β Version)

'sort' command - 2 minute tutorial

Overview of 'sort' command

The 'sort' unix command can sort all the lines in a file.

This sorting can be done by comparing the lines from the first character itself or you can specify the field/s on which to sort. Additionally, sorting can be done either in dictionary order or numerical order.

We will start with a few basic examples and then explore all the advanced options that 'sort' provides in the next few pages.