Sorting the content of a file
The sort command is a simple database tool. It allows you to specify the field to be sorted on and the type of sort to be carried out on it.
sort filename
Lines are sorted into the following order: lines starting with numbers come first, followed by lines starting with upper-case letters, which are followed by lines starting with lower-case letters and finally symbols such as % and !.
- Examples
- Sorting on a specific field
- Saving the results of a sort to a file
- Checking if a file has been sorted
- Merging sorted files
- Changing the sort order
- Removing multiple occurrences of a line
This site maintained by
unixhelp@math.rutgers.edu



