[prev] [index] [next]

sort: sort lines (cont)

Examples:

# sort numbers in 3rd column in descending order
sort +2nr data

# sort the password file based on user name
sort -t: +4 /etc/passwd
 
# sort and replace the contents of the file "mydata"
sort -o mydata mydata

# sort on data lying between the 10th and 20th character position,
# then the first 5 characters
sort +0.9 -0.20 +0 -0.5