UNIQ(1) BSD UNIQ(1)
NAME
uniq - report repeated lines in a file
SYNOPSIS
uniq [ -udc [ +n ] [ -n ] ] [ input [ output ] ]
DESCRIPTION
uniq reads the input file, comparing adjacent lines. Normally it removes
the second and succeeding copies of repeated lines, and writes the
remainder on the output file. Repeated lines must be adjacent in order
to be found; refer to sort(1) for more information on this. The normal
mode output is the union of the -u and -d mode outputs.
OPTIONS
-u Output only the lines not repeated in the original file.
-d Write one copy of only the repeated lines.
-c Supersede the -u and -d options. Generate an output report in
default style, but with each line preceded by a count of the
number of times it occurred.
-n Ignore the first n fields, together with any blanks before
each. A field is defined as a string of nonspace, nontab
characters separated from adjacent characters by tabs and
spaces.
+n Ignore the first n characters. Fields are skipped before
characters.
SEE ALSO
comm(1), sort(1)