SORT command in Unix


The sort command in UNIX  is used to arrange the lines of text alphabetically. It will just sort the text alphabetically and displays in the command line. The content of the file will not be modified.


filename file.txt

Sort file.txt :

returns the following results:

There are many options in sort command. Below are the details,

Sort -n :-

  • This will sort numerically and it will ignore blanks and tabs. If the file contains text as well as numeric lines, then it will first sort alphabets and then it will sort numeric line from low value to high value.

Sort -r :-

  • It will sort the text from the files in reverse order.

Sort -f :-

  • This will sort upper and lowercase texts together.


Below are the list of advanced UNIX commands used in UNIX operation system.

1 .GREP Command in Unix 
2.Whoami Command in Unix
3.Passwd Command in Unix
4.Kill Command in Unix
5.Ps -Ef Command in Unix
6.Df -k Command in Unix
7.Bdf Command in Unix
8.ftp Command in Unix
9.Find Command in Unix
10.Date Command in Unix
11.Uptime Command in Unix
12.Clear Command in Unix
13.Shift Command in Unix
14.Sort Command in Unix
15.Crontab Command in Unix
16.Unix Command Line Arguments


Share this website !!!
Facebook Twitter Linkedin