sort (Sort Ubuntu Linux command Tutorials)

  • sort is used to sort the contents of file in ascending order and print on the screen.

  • sort command does not make changes in the original file.

  • It can work with number as well as characters.

Syntax

sort filename

 

  • The following snapshot shows the content of 1.txt as well as output of the sort command on 1.txt file.

 

 

  • The following snapshot shows the content of names.txt as well as output of the sort command on names.txt file.

 


border