Real dream is the other shore of reality.
真正的梦就是现实的彼岸
[root@localhost ~]# more 1.txtthis is a testthis is a testthis is a testi am tanki love tanki love tankthis is a testwhom have a tryWhoM have a tryyou have a tryi want to abroadthose are good menwe are good men#uniq的一个特性,检查重复行的时候,只会检查相邻的行。重复数据,肯定有很多不是相邻在一起的[zhangy@BlackGhost mytest]$ uniq -c 1.txt3 this is a test1 i am tank2 i love tank1 this is a test #和第一行是重复的1 whom have a try1 WhoM have a try1 you? have a try1 i want to abroad1 those are good men1 we are good men#这个方式就解决了上面的问题,先进行sort以下[root@localhost ~]# sort 1.txt | uniq -c1 i am tank2 i love tank1 i want to abroad4 this is a test1 those are good men1 we are good men1 whom have a try1 WhoM have a try1 you have a try#数量排序 ,这个才是我想要的结果[root@localhost ~]# sort 1.txt | uniq -c | sort -r4 this is a test2 i love tank1 you have a try1 WhoM have a try1 whom have a try1 we are good men1 those are good men1 i want to abroad1 i am tank[root@localhost ~]# more 1.txt this is a test this is a test this is a test i am tank i love tank i love tank this is a test whom have a try WhoM have a try you have a try i want to abroad those are good men we are good men #uniq的一个特性,检查重复行的时候,只会检查相邻的行。重复数据,肯定有很多不是相邻在一起的 [zhangy@BlackGhost mytest]$ uniq -c 1.txt 3 this is a test 1 i am tank 2 i love tank 1 this is a test #和第一行是重复的 1 whom have a try 1 WhoM have a try 1 you? have a try 1 i want to abroad 1 those are good men 1 we are good men #这个方式就解决了上面的问题,先进行sort以下 [root@localhost ~]# sort 1.txt | uniq -c 1 i am tank 2 i love tank 1 i want to abroad 4 this is a test 1 those are good men 1 we are good men 1 whom have a try 1 WhoM have a try 1 you have a try #数量排序 ,这个才是我想要的结果 [root@localhost ~]# sort 1.txt | uniq -c | sort -r 4 this is a test 2 i love tank 1 you have a try 1 WhoM have a try 1 whom have a try 1 we are good men 1 those are good men 1 i want to abroad 1 i am tank[root@localhost ~]# more 1.txt this is a test this is a test this is a test i am tank i love tank i love tank this is a test whom have a try WhoM have a try you have a try i want to abroad those are good men we are good men #uniq的一个特性,检查重复行的时候,只会检查相邻的行。重复数据,肯定有很多不是相邻在一起的 [zhangy@BlackGhost mytest]$ uniq -c 1.txt 3 this is a test 1 i am tank 2 i love tank 1 this is a test #和第一行是重复的 1 whom have a try 1 WhoM have a try 1 you? have a try 1 i want to abroad 1 those are good men 1 we are good men #这个方式就解决了上面的问题,先进行sort以下 [root@localhost ~]# sort 1.txt | uniq -c 1 i am tank 2 i love tank 1 i want to abroad 4 this is a test 1 those are good men 1 we are good men 1 whom have a try 1 WhoM have a try 1 you have a try #数量排序 ,这个才是我想要的结果 [root@localhost ~]# sort 1.txt | uniq -c | sort -r 4 this is a test 2 i love tank 1 you have a try 1 WhoM have a try 1 whom have a try 1 we are good men 1 those are good men 1 i want to abroad 1 i am tank
In the face of difficulties, be brave, persistent and tirelessly to overcome it.
面对困难的时候,要勇敢、执着、不畏艰辛地去战胜它
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END
暂无评论内容