OS Manuals

/usr/bin/uniq

Cross-platform Rust rewrite of the GNU coreutils.

From uutils 0.12.0-r6 (os), captured 2026-11-07 by running uniq --help (exit 0). permalink

Report or omit repeated lines.

Usage: uniq [OPTION]... [INPUT [OUTPUT]]

Options:
  -D, --all-repeated[=<delimit-method>]
          print all duplicate lines. Delimiting is done with blank lines. [default: none] [possible
          values: none, prepend, separate]
      --group[=<group-method>]
          show all items, separating groups with an empty line. [default: separate] [possible
          values: separate, prepend, append, both]
  -w, --check-chars <N>
          compare no more than N characters in lines
  -c, --count
          prefix lines by the number of occurrences
  -i, --ignore-case
          ignore differences in case when comparing
  -d, --repeated
          only print duplicate lines
  -s, --skip-chars <N>
          avoid comparing the first N characters
  -f, --skip-fields <N>
          avoid comparing the first N fields
  -u, --unique
          only print unique lines
  -z, --zero-terminated
          end lines with 0 byte, not newline
  -h, --help
          Print help
  -V, --version
          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.
Options (12)
OptionDescriptionSource
-D, --all-repeated delimit-methodprint all duplicate lines.help
--group group-methodshow all items, separating groups with an empty line.help
-w, --check-chars Ncompare no more than N characters in lineshelp + man
-c, --countprefix lines by the number of occurrenceshelp + man
-i, --ignore-caseignore differences in case when comparinghelp + man
-d, --repeatedonly print duplicate lineshelp + man
-s, --skip-chars Navoid comparing the first N charactershelp + man
-f, --skip-fields Navoid comparing the first N fieldshelp + man
-u, --uniqueonly print unique lineshelp + man
-z, --zero-terminatedend lines with 0 byte, not newlinehelp + man
-h, --helpPrint helphelp + man
-V, --versionPrint versionhelp + man

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.