uniq -- remove duplicate lines from a sorted file


uniq is as specified in the Single UNIX Specification but with differences as listed below.

LSB Deprecated Differences

The behaviors specified in this section are expected to disappear from a future version of the LSB; applications should only use the non-LSB-deprecated behaviors.


is equivalent to -c.


is equivalent to -d.

-D, --all-repeated

prints all duplicate lines.


is equivalent to -f fields.

-i, --ignore-case

ignores differences in case when comparing.


is equivalent to -s.


is equivalent to -u.

-w, --check-chars=N

compares no more than N characters in lines.


outputs version information and exits.