sort command

The sort command is used to sort the lines of a text file in ascending or descending order, or sort as per a specified key. The following example illustrates the working of the sort command.

An example of the sort command to sort the /etc/passwd file in ascending order is shown in the following screenshot:

An example of the sort command to sort the /etc/passwd file by the third field numerically is shown in the following screenshot. Here, the -t option specifies a delimiter and the -k option specifies a field to be used for sorting:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.155.187