Go to the first, previous, next, last section, table of contents.
uniq
writes the unique lines in the given `input', or
standard input if nothing is given or for an input name of
`-'. Synopsis:
uniq [option]... [input [output]]
By default, uniq
prints the unique lines in a sorted file, i.e.,
discards all but one of identical successive lines. Optionally, it can
instead show only lines that appear exactly once, or lines that appear
more than once.
The input must be sorted. If your input is not sorted, perhaps you want
to use sort -u
.
If no output file is specified, uniq
writes to standard
output.
The program accepts the following options. Also see section Common options.
- `-n'
-
- `-f n'
-
- `--skip-fields=n'
-
Skip n fields on each line before checking for uniqueness. Fields
are sequences of non-space non-tab characters that are separated from
each other by at least one spaces or tabs.
- `+n'
-
- `-s n'
-
- `--skip-chars=n'
-
Skip n characters before checking for uniqueness. If you use both
the field and character skipping options, fields are skipped over first.
- `-c'
-
- `--count'
-
Print the number of times each line occurred along with the line.
- `-i'
-
- `--ignore-case'
-
Ignore differences in case when comparing lines.
- `-d'
-
- `--repeated'
-
Print only duplicate lines.
- `-u'
-
- `--unique'
-
Print only unique lines.
- `-w n'
-
- `--check-chars=n'
-
Compare n characters on each line (after skipping any specified
fields and characters). By default the entire rest of the lines are
compared.
Go to the first, previous, next, last section, table of contents.