File:  [Research Unix] / researchv10dc / man / adm / man1 / uniq.1
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Tue Apr 24 17:21:34 2018 UTC (8 years, 1 month ago) by root
Branches: belllabs, MAIN
CVS tags: researchv10, HEAD
researchv10 Dan Cross

.TH UNIQ 1
.CT 1 files
.SH NAME
uniq \- report repeated lines in a file
.SH SYNOPSIS
.B uniq
[
.B -udc
[
.BI +- num
]
]
[
.I file
]
.SH DESCRIPTION
.I Uniq
copies the input
.I file,
or the standard input, to the
standard output comparing adjacent lines.
In the normal case, the second and succeeding copies
of repeated lines are
removed.
Repeated lines must be adjacent
in order to be found.
.TP
.B -u
Print unique lines.
.TP
.B -d
Print (one copy of) duplicated lines.
.TP
.B -c
Prefix a repetition count and a tab to each output line.
Implies
.B -u
and
.BR -d .
.TP
.BI - num
The first
.IR num
fields
together with any blanks before each are ignored.
A field is defined as a string of non-space, non-tab characters
separated by tabs and spaces from its neighbors.
.TP
.BI + num
The first
.IR num
characters are ignored.
Fields are skipped before characters.
.SH EXAMPLES
.TP
.B
cut -d: -f3 /etc/passwd | sort | uniq -d
Print duplicated userids from the password file,
.IR passwd (5).
.I Cut
picks out the userid (the third colon-delimited field) and
.I sort
brings repetitions together.
.SH "SEE ALSO"
.IR sort (1), 
.IR comm (1)
.SH BUGS
Field-selection and comparison should be compatible with 
.IR sort (1).

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.