~/uniq(1)
en
NAME
uniq - collapse repeated lines
SYNOPSIS
uniq [-cd] [file ...]
DESCRIPTION
Collapses lines that repeat, and only ones that are next to each other –
which is why it is nearly always sort | uniq rather than uniq alone. That
is not a shortcoming; it is what lets it work on something far too big to
hold, which is what it was written for.
OPTIONS
- -c
- count how many of each there were
- -d
- only the lines that repeated
EXAMPLES
sort names.txt | uniq
sort names.txt | uniq -c