~/uniq(1) en

UNIQ(1)General Commands ManualUNIQ(1)

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

SEE ALSO

sort(1), wc(1), sh(1)

tilenkoren.com2026UNIQ(1)