标签:
 uniq file // 删除连续重复的行,跳跃的不算
 uniq 
      -c      // 显示重复的数量
      -d      // 仅显示重复的
      -u      // 显示没重复的行
      -f      // 忽略 每行 的前几个字段
      -i      // 不区分大小写
root@benjamin:~/tmp# cat foo.dat 
a
a
a
b
b
a
a
c
root@benjamin:~/tmp# uniq foo.dat 
a
b
a
c
root@benjamin:~/tmp# uniq -c foo.dat 
      3 a
      2 b
      2 a
      1 c
root@benjamin:~/tmp# uniq -d foo.dat 
a
b
a
root@benjamin:~/tmp# uniq -u foo.dat 
c
标签:
原文地址:http://www.cnblogs.com/benjaming/p/4386223.html