Research V3 release
[unix-history] / man / man1 / uniq.1
.pa 1
.he 'UNIQ (I)'12/1/72'UNIQ (I)'
.ti 0
NAME uniq -- report repeated lines in a file
.sp
.ti 0
SYNOPSIS uniq\b\b\b\b____ [ -ud\b\b\b___ ] [ input [ output ] ]
.sp
.ti 0
DESCRIPTION uniq\b\b\b\b____
reads the input
file comparing adjacent lines.
In the normal case, the second and succeeding copies
of repeated lines are
removed; the remainder is written on the output file.
Note that repeated lines must be adjacent
in order to be found.
(See sort(I))
If the -u\b\b__ flag is used,
just the lines that are not repeated
in the original file are output.
The -d\b\b__ option specifies that
one copy of just the repeated lines is to
be written.
Note that the normal mode output is the union of the
-u\b\b__ and -d\b\b__ mode outputs.
.sp
The following example will print one copy of all
lines in the file a\b_ that do not occur in b\b_:
.sp
sort a x
uniq x a1
sort b x
uniq x b1
cat a1 b1 >x
sort x
uniq -u x >>a1
sort a1
uniq -d a1
.sp
.ti 0
FILES --
.sp
.ti 0
SEE ALSO sort(I)
.sp
.ti 0
DIAGNOSTICS "cannot open input", "cannot create output"
.sp
.ti 0
BUGS --