manual page distributed with 4.1BSD
[unix-history] / usr / src / usr.bin / uniq / uniq.1
CommitLineData
f2028daa
KM
1.\" @(#)uniq.1 4.1 (Berkeley) %G%
2.\"
3.TH UNIQ 1
4.AT 3
5.SH NAME
6uniq \- report repeated lines in a file
7.SH SYNOPSIS
8.B uniq
9[
10.B \-udc
11[
12.BR + n
13] [
14.BR \- n
15]
16] [ input [ output ] ]
17.SH DESCRIPTION
18.I Uniq
19reads the input
20file comparing adjacent lines.
21In the normal case, the second and succeeding copies
22of repeated lines are
23removed; the remainder is written on the output file.
24Note that repeated lines must be adjacent
25in order to be found;
26see
27.IR sort (1).
28If the
29.B \-u
30flag is used,
31just the lines that are not repeated
32in the original file are output.
33The
34.B \-d
35option specifies that
36one copy of just the repeated lines is to
37be written.
38The normal mode output is the union of the
39.B \-u
40and
41.B \-d
42mode outputs.
43.PP
44The
45.B \-c
46option supersedes
47.B \-u
48and
49.B \-d
50and generates
51an output report in default style
52but with each line preceded by a count of the
53number of times it occurred.
54.PP
55The
56.I n
57arguments specify skipping an initial portion of each line
58in the comparison:
59.TP 8
60.BI \- n
61The first
62.IR n
63fields
64together with any blanks before each are ignored.
65A field is defined as a string of non-space, non-tab characters
66separated by tabs and spaces from its neighbors.
67.TP 8
68.BI + n
69The first
70.IR n
71characters are ignored.
72Fields are skipped before characters.
73.PP
74.SH "SEE ALSO"
75sort(1), comm(1)