| sed '/ATT (NEW)/d'
[unix-history] / usr / src / usr.bin / uniq / uniq.1
CommitLineData
a04b42ee 1.\" @(#)uniq.1 6.1 (Berkeley) %G%
f2028daa 2.\"
a04b42ee 3.TH UNIQ 1 ""
f2028daa
KM
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
d60d0b29
KM
19reads the input file comparing adjacent lines.
20In the normal case, the second and succeeding copies of repeated lines are
f2028daa 21removed; the remainder is written on the output file.
d60d0b29 22Note that repeated lines must be adjacent in order to be found; see
f2028daa
KM
23.IR sort (1).
24If the
25.B \-u
d60d0b29
KM
26flag is used, just the lines that are not repeated
27in the original file are output. The
f2028daa 28.B \-d
d60d0b29 29option specifies that one copy of just the repeated lines is to be written.
f2028daa
KM
30The normal mode output is the union of the
31.B \-u
32and
33.B \-d
34mode outputs.
35.PP
36The
37.B \-c
38option supersedes
39.B \-u
40and
41.B \-d
d60d0b29
KM
42and generates an output report in default style
43but with each line preceded by a count of the number of times it occurred.
f2028daa
KM
44.PP
45The
46.I n
d60d0b29 47arguments specify skipping an initial portion of each line in the comparison:
f2028daa
KM
48.TP 8
49.BI \- n
50The first
51.IR n
d60d0b29 52fields together with any blanks before each are ignored.
f2028daa
KM
53A field is defined as a string of non-space, non-tab characters
54separated by tabs and spaces from its neighbors.
55.TP 8
56.BI + n
57The first
58.IR n
d60d0b29 59characters are ignored. Fields are skipped before characters.
f2028daa
KM
60.PP
61.SH "SEE ALSO"
62sort(1), comm(1)