uniq

说明:只能用于排过序的数据输入,或者与sort配合使用。(下面的文件都是经过排序处理的文件或者未排序文件配合sort使用)

  • uniq file:去除重复行数据(sort file | uniq)
  • uniq -u file:显示没有重复的行数据(sort file | uniq -u)
  • uniq -c file:统计重复次数(sort file | uniq -c)
  • uniq -d file:显示重复的行数据(sort file | uniq -d)
  • uniq -s n:跳过前n个字符
  • uniq -w n:最多比较n个字符
posted @ 2017-06-04 19:47  爱上咖啡的唐  阅读(183)  评论(0编辑  收藏  举报