uniq命令:
uniq [OPTION]... [FILE]...
-c: 顯示每行重復(fù)出現(xiàn)的次數(shù);
[root@ansible ~]# cat test.txt
this is test
this is test
this is your list
this is this
[root@ansible ~]# uniq -c test.txt
2 this is test
1 this is your list
1 this is this
-d: 僅顯示重復(fù)過的行金闽;
[root@ansible ~]# cat test.txt
this is test
this is test
this is your list
this is this
[root@ansible ~]# uniq -d test.txt
this is test
-u: 僅顯示不曾重復(fù)的行;
[root@ansible ~]# cat test.txt
this is test
this is test
this is your list
this is this
[root@ansible ~]# uniq -u test.txt
this is your list
this is this