uniq — Report or Filter Out Repeated Lines in a File

Synopsis

/usr/bin/uniq [-c|-d|-u][-ffields][-schars][input-file [output-file]] 
/usr/bin/uniq [-c|-d|-u][-n][+m][input-file [output-file]] 

Description

The uniq command produces a list of the unique lines in a file by filtering or removing repeated lines. It is usually used with files that have first been sorted with the sort(1) command.

uniq reads an input file, compares adjacent lines, and writes one copy of each input line on the output. The second and succeeding copies of repeated adjacent input lines are not written.

Repeated lines in the input are not detected if they are not adjacent.

Options

-c Precede each output line with a count of the number of times the line occurred in the ...

Get Solaris™ 7 Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.