UNIQ(1) General Commands Manual UNIQ(1)

uniq - Report or omit repeated lines.

uniq [-D|--all-repeated] [--group] [-w|--check-chars] [-c|--count] [-i|--ignore-case] [-d|--repeated] [-s|--skip-chars] [-f|--skip-fields] [-u|--unique] [-z|--zero-terminated] [-h|--help] [-V|--version] [files]

Report or omit repeated lines.

print all duplicate lines. Delimiting is done with blank lines. [default: none]

Possible values:

  • none
  • prepend
  • separate
show all items, separating groups with an empty line. [default: separate]

Possible values:

  • separate
  • prepend
  • append
  • both
compare no more than N characters in lines
prefix lines by the number of occurrences
ignore differences in case when comparing
only print duplicate lines
avoid comparing the first N characters
avoid comparing the first N fields
only print unique lines
end lines with 0 byte, not newline
Print help
Print version

Filter adjacent matching lines from INPUT (or standard input), writing to OUTPUT (or standard output).

Note: uniq does not detect repeated lines unless they are adjacent. You may want to sort the input first, or use sort -u without uniq.

v(uutils coreutils) 0.9.0

2026-05-31