1
0
mirror of git://git.suckless.org/sbase synced 2024-12-25 08:22:44 +00:00
sbase/uniq.1

53 lines
1021 B
Groff

.Dd January 30, 2015
.Dt UNIQ 1
.Os sbase
.Sh NAME
.Nm uniq
.Nd report or filter out repeated lines in a file
.Sh SYNOPSIS
.Nm
.Op Fl c
.Op Fl d | u
.Op Fl f Ar fields
.Op Fl s Ar chars
.Op Ar input Op Ar output
.Sh DESCRIPTION
.Nm
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,
.Nm
reads from stdin. If no
.Ar output
file is given, then
.Nm
writes to stdout.
.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).
.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.
.El
.Sh STANDARDS
The
.Nm
utility is compliant with the
.St -p1003.1-2008
specification.