From:http://www.xiaoxiaozi.com/2009/12/01/1652/
sort的作用與用法
NAME
sort - sort lines of text files
SYNOPSIS
sort [OPTION] ... [FILE] ...
DESCRIPTION
Write sorted concatenation of all FILE(s) to standard output.
簡單測試文件:demo.txt
1
3
4
6
9
8
7
2
5
10
爲了不佔用太多空間造成浪費,我將結果以一行的形式展現給大家,勿怪~
sort demo.txt
#1 10 2 3 4 5 6 7 8 9
sort -n demo.txt
#1 2 3 4 5 6 7 8 9 10
sort -nr demo.txt
#10 9 8 7 6 5 4 3 2 1