Merge branch 'master' of https://github.com/shigemk2/cheat into shigemk2-master

* 'master' of https://github.com/shigemk2/cheat:
  Refer sort -u
  Fix dc option
  uniq: add examples
This commit is contained in:
Chris Lane 2015-02-09 18:06:20 -05:00
commit f5ee3d5e29
1 changed files with 13 additions and 0 deletions

13
cheat/cheatsheets/uniq Normal file
View File

@ -0,0 +1,13 @@
# show all lines without duplication
# "sort -u" and "uniq" is the same effect.
sort file | uniq
# show not duplicated lines
sort file | uniq -u
# show duplicated lines only
sort file | uniq -d
# count all lines
sort file | uniq -c
# count not duplicated lines
sort file | uniq -uc
# count only duplicated lines
sort file | uniq -dc