The following command reads the file EXPENSES.TXT, sorts it in reverse order,
and displays it on your screen:
sort /r < expenses.txt
Suppose you want to search a large file named MAILLST.TXT for the text
"Jones", and suppose you want to sort the results of the search. To do this, use the
pipe (|) to direct the output of a find command to the SORT command, as shown in the following example:
find "Jones" maillist.txt | sort
The command produces a sorted list of lines that contain the specified text.
To sort keyboard input and display the results alphabetically on the screen,
you can first use the sort command with no parameters, as the following example shows:
Then type the text you want sorted, pressing ENTER at the end of each line.
When you have finished typing text, press CTRL+Z, and then press ENTER. The sort command displays the text you typed, sorted alphabetically. You could also
redirect sorted keyboard input to a file.
More Information About Sort