2015-01-09 16:28:18 +01:00
|
|
|
# show all lines without duplication
|
2015-01-12 13:29:35 +01:00
|
|
|
# "sort -u" and "uniq" is the same effect.
|
2015-01-09 16:28:18 +01:00
|
|
|
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
|
2015-01-12 13:17:55 +01:00
|
|
|
sort file | uniq -dc
|