Linux sort的選項(參數)與用法舉例

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
 
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章