Research V4 development
[unix-history] / man / man1 / uniq.1
CommitLineData
4b0376ce
KT
1.th UNIQ I 12/1/72
2.sh NAME
3uniq \*- report repeated lines in a file
4.sh SYNOPSIS
5.bd uniq
6[
7.bd \*-udc
8[ \fB+\fRn ] [ \fB\*-\fRn ]
9] [ input [ output ] ]
10.sh DESCRIPTION
11.it Uniq
12reads the input
13file comparing adjacent lines.
14In the normal case, the second and succeeding copies
15of repeated lines are
16removed; the remainder is written on the output file.
17Note that repeated lines must be adjacent
18in order to be found;
19see sort(I).
20If the
21.bd \*-u
22flag is used,
23just the lines that are not repeated
24in the original file are output.
25The
26.bd \*-d
27option specifies that
28one copy of just the repeated lines is to
29be written.
30The normal mode output is the union of the
31.bd \*-u
32and
33.bd \*-d
34mode outputs.
35.s3
36The
37.bd \*-c
38option supersedes
39.bd \*-u
40and
41.bd \*-d
42and generates
43an output report in the style of
44.bd \*-ud
45but with each line preceded by a count of the
46number of times it occurred.
47.s3
48The
49.it n
50arguments specify skipping an initial portion of each line
51in the comparison:
52.s3
53.lp +8 4
54\fB\*-\fIn\fR The first \fIn\fR fields
55together with any blanks before each are ignored.
56A field is defined as a string of non-space, non-tab characters
57separated by tabs and spaces from its neighbors.
58.s3
59.lp +8 4
60\fB+\fIn\fR The first \fIn\fR characters are ignored.
61Fields are skipped before characters.
62.i0
63.s3
64.sh "SEE ALSO"
65sort(I), comm(I)
66.sh BUGS