2015-01-30 15:51:23 -05:00
|
|
|
.Dd January 30, 2015
|
2015-01-31 08:20:02 -05:00
|
|
|
.Dt UNIQ 1
|
2015-01-31 14:37:03 -05:00
|
|
|
.Os sbase
|
2015-01-30 15:51:23 -05:00
|
|
|
.Sh NAME
|
|
|
|
.Nm uniq
|
|
|
|
.Nd report or filter out repeated lines in a file
|
|
|
|
.Sh SYNOPSIS
|
|
|
|
.Nm
|
2015-02-11 07:12:21 -05:00
|
|
|
.Op Fl c
|
|
|
|
.Op Fl d | u
|
|
|
|
.Op Fl f Ar fields
|
|
|
|
.Op Fl s Ar chars
|
2015-02-11 09:56:16 -05:00
|
|
|
.Op Ar input Op Ar output
|
2015-01-30 15:51:23 -05:00
|
|
|
.Sh DESCRIPTION
|
|
|
|
.Nm
|
2015-02-11 10:18:10 -05:00
|
|
|
reads the
|
|
|
|
.Ar input
|
|
|
|
file and writes one copy of a line from each group of consecutive
|
|
|
|
duplicate lines to the
|
|
|
|
.Ar output
|
|
|
|
file. If no
|
|
|
|
.Ar input
|
|
|
|
file is given,
|
2015-02-01 14:52:28 -05:00
|
|
|
.Nm
|
2015-02-11 10:18:10 -05:00
|
|
|
reads from stdin. If no
|
|
|
|
.Ar output
|
|
|
|
file is given, then
|
|
|
|
.Nm
|
|
|
|
writes to stdout.
|
2015-01-30 15:51:23 -05:00
|
|
|
.Sh OPTIONS
|
|
|
|
.Bl -tag -width Ds
|
|
|
|
.It Fl c
|
2015-02-01 14:52:28 -05:00
|
|
|
Prefixes each line with a count of its consecutive occurrences in the input.
|
2015-01-30 15:51:23 -05:00
|
|
|
.It Fl d
|
2015-02-01 14:52:28 -05:00
|
|
|
Suppresses non-duplicate lines (thus 'uniq -d' prints only duplicates).
|
2015-01-30 15:51:23 -05:00
|
|
|
.It Fl u
|
2015-02-01 14:52:28 -05:00
|
|
|
Suppresses non-unique lines (thus 'uniq -u' prints only uniques).
|
2015-02-11 07:12:21 -05:00
|
|
|
.It Fl f Ar fields
|
|
|
|
Ignore the first
|
|
|
|
.Ar fields
|
|
|
|
in each input line when doing comparisons.
|
|
|
|
.It Fl s Ar chars
|
|
|
|
Ignore the first
|
|
|
|
.Ar chars
|
|
|
|
characters in each input line when doing comparisons.
|
2015-01-30 15:51:23 -05:00
|
|
|
.El
|
2015-02-11 10:55:58 -05:00
|
|
|
.Sh STANDARDS
|
|
|
|
The
|
|
|
|
.Nm
|
|
|
|
utility is compliant with the
|
|
|
|
.St -p1003.1-2008
|
|
|
|
specification.
|