sort--uniq

sort

-u file 消除重复的行

-n 升序,算术排序

-r 逆序 

sort -k3n -t: /etc/passwd 以冒号为分隔符,第三个字符进行算术排序

uniq

uniq -d file 列出重复的行

uniq -c 统计出现重复行的次数

cat file | sort -n | uniq -c 

posted on 2018-08-01 15:56  朱传宝  阅读(114)  评论(0编辑  收藏  举报