sort--uniq
sort
-u file 消除重复的行
-n 升序,算术排序
-r 逆序
sort -k3n -t: /etc/passwd 以冒号为分隔符,第三个字符进行算术排序
uniq
uniq -d file 列出重复的行
uniq -c 统计出现重复行的次数
cat file | sort -n | uniq -c
sort
-u file 消除重复的行
-n 升序,算术排序
-r 逆序
sort -k3n -t: /etc/passwd 以冒号为分隔符,第三个字符进行算术排序
uniq
uniq -d file 列出重复的行
uniq -c 统计出现重复行的次数
cat file | sort -n | uniq -c