[root@panyu001 test]# cat test.txt
i
3
1
f
cscc c dss
sort : -n(数字排序) -r(反序) -t(分隔符)
[root@panyu001 test]# sort test.txt1
3
cc c dss
cs
f
i
[root@panyu001 test]# sort -n test.txtcc c dss
cs
f
i
1
3
[root@panyu001 test]# sort -nr test.txt
3
1
i
f
cs
cc c dss
wc -l:统计行数 ; -m:统计字符数 ; -w:统计单词数
[root@panyu001 test]# wc -l test.txt #统计行数,包括空行
7 test.txt
[root@panyu001 test]# cat -A test.txt #查看隐藏字符
i$
3$
1$
f$
cs$
$
cc c dss$
[root@panyu001 test]# wc -m test.txt #统计字符数,每行行尾都有隐藏的$换行符,也会被统计当中
22 test.txt
[root@panyu001 test]# wc -w test.txt #统计单词数,字符以空格为分割符,逗号不算分割
8 test.txt
uniq:去重复行
[root@panyu001 test]# sort test.txt |uniq