示例
jack@linuxworld:/tmp$ cat list Air water soil chemical seas red green flower seas towers trees languages flower boat water jack@linuxworld:/tmp$ jack@linuxworld:/tmp$ sort list |uniq -c -d 2 flower 2 seas 2 water jack@linuxworld:/tmp$
要查找文件中的重复行,请使用下面给定的命令
sort file-name|uniq -c -d
其中
sort –对文本文件行进行排序
file-name -查找的文件
uniq -报告或者忽略重复行
对于uniq命令,我们使用以下给定参数:
-c、 –按出现次数计算行数
-d、 –只打印重复行
日期:2019-08-20 17:58:32 来源:oir作者:oir