80 lines
1.6 KiB
Groff
80 lines
1.6 KiB
Groff
.\" @(#)uniq.1 1.1 94/10/31 SMI; from UCB 4.2
|
|
.TH UNIQ 1 "9 September 1987"
|
|
.SH NAME
|
|
uniq \- remove or report adjacent duplicate lines
|
|
.SH SYNOPSIS
|
|
.B uniq
|
|
[
|
|
.B \-cdu
|
|
[
|
|
.BR + \||\| \-\fIn\fP
|
|
]
|
|
[
|
|
.I inputfile
|
|
[
|
|
.I outputfile
|
|
] ]
|
|
.IX "uniq command" "" "\fLuniq\fP \(em remove repeated lines"
|
|
.IX remove "repeated lines \(em \fLuniq\fP"
|
|
.IX delete "repeated lines \(em \fLuniq\fP"
|
|
.IX "sorted file" "remove repeated lines" "" "remove repeated lines \(em \fLuniq\fP"
|
|
.IX "text processing utilities" uniq "" "\fLuniq\fP \(em remove repeated lines"
|
|
.SH DESCRIPTION
|
|
.LP
|
|
.B uniq
|
|
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: repeated lines must be adjacent in order to be found; see
|
|
.BR sort (1V).
|
|
.SH OPTIONS
|
|
.TP
|
|
.B \-c
|
|
Supersede
|
|
.B \-u
|
|
and
|
|
.B \-d
|
|
and generate an output report in default style
|
|
but with each line preceded by a count of the number of times it occurred.
|
|
.LP
|
|
The normal output of
|
|
.B uniq
|
|
is the union of the
|
|
.B \-u
|
|
and
|
|
.B \-d
|
|
options.
|
|
.TP
|
|
.B \-d
|
|
Write one copy of just the repeated lines.
|
|
.TP
|
|
.B \-u
|
|
Copy only those lines which are
|
|
.I not
|
|
repeated in the original file.
|
|
.LP
|
|
The
|
|
.I n
|
|
arguments specify skipping an initial portion of each line in the comparison:
|
|
.TP 8
|
|
.BI + n
|
|
The first
|
|
.IR n
|
|
characters are ignored. Fields are skipped before characters.
|
|
.TP
|
|
.BI \- n
|
|
The first
|
|
.IR n
|
|
fields together with any blanks before each are ignored.
|
|
A field is defined as a string of non-\s-1SPACE\s0,
|
|
non-\s-1TAB\s0
|
|
characters separated by
|
|
.SM SPACE
|
|
and
|
|
.SM TAB
|
|
characters from its neighbors.
|
|
.SH "SEE ALSO"
|
|
.BR comm (1),
|
|
.BR sort (1V)
|