2015-01-30 20:51:23 +00:00
|
|
|
.Dd January 30, 2015
|
2015-01-31 13:20:02 +00:00
|
|
|
.Dt UNIQ 1
|
2015-01-31 19:37:03 +00:00
|
|
|
.Os sbase
|
2015-01-30 20:51:23 +00:00
|
|
|
.Sh NAME
|
|
|
|
.Nm uniq
|
|
|
|
.Nd report or filter out repeated lines in a file
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
|
|
|
.Op Fl cdu
|
|
|
|
.Op Ar file
|
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
|
|
|
reads file and writes one copy of a line from each group of consecutive
|
|
|
|
duplicate lines to stdout. If no file is given, uniq reads from stdin.
|
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl c
|
|
|
|
prefixes each line with a count of its consecutive occurrences in the input.
|
|
|
|
.It Fl d
|
|
|
|
suppresses non-duplicate lines (thus 'uniq -d' prints only duplicates).
|
|
|
|
.It Fl u
|
|
|
|
suppresses non-unique lines (thus 'uniq -u' prints only uniques).
|
|
|
|
.El
|
|
|
|
.Sh BUGS
|
2012-05-21 23:46:22 +00:00
|
|
|
The original sbase implementation of
|
2015-01-30 20:51:23 +00:00
|
|
|
.Nm
|
|
|
|
supported multiple input-file arguments as e.g.
|
|
|
|
.Xr cat 1
|
|
|
|
and
|
|
|
|
.Xr grep 1
|
|
|
|
do.
|
|
|
|
Unfortunately, POSIX uniq treats its second argument (if present) as an
|
|
|
|
output filename and clobbers it. Since users and scripts which rely on
|
|
|
|
.Nm
|
|
|
|
supporting multiple input-file arguments would be at risk of data loss
|
|
|
|
if they ever ran into a POSIX-compatible
|
|
|
|
.Nm
|
|
|
|
, support for multiple input-file arguments was removed from this
|
|
|
|
implementation.
|