shell命令uniq

发布时间:2017-06-24 22:30:22 阅读:1071次

 uniq命令通过消除重复内容,只能用于排过序的数据

cat sorted.txt

bash

foss 

hack

hack

uniq sorted.txt

bash

foss

hack

sort unsorted.txt|uniq

sort -u unsorted.txt

只显示唯一的行

uniq -u sorted.txt

bash

foss

sort unsorted.txt | uniq -u

sort unsorted.txt | uniq -c

1 bash

1 foss

2 hack

找出文件中重复的行

sort unsorted.txt | uniq -d

hack

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询
上一篇:shell命令sort

转载请注明:shell命令uniq 出自老鄢博客 | 欢迎分享