UNIQ(1) General Commands Manual UNIQ(1)

uniq - report repeated lines in a file

uniq [ -udc ] [ file ]

Uniq copies the input file, or the standard input, to the standard output, comparing adjacent lines. In the normal case, the second and succeeding copies of repeated lines are removed. Repeated lines must be adjacent in order to be found.

Print unique lines.
Prefix a repetition count and a tab to each output line.
Print (one copy of) duplicated lines.

/appl/cmd/uniq.b

comm (1), sort (1)