uniq
v(uutils coreutils) 0.1.0
Options
--all-repeated=<delimit-method>,-D <delimit-method>-
uniq-help-all-repeated
--group=<group-method>-
uniq-help-group
--check-chars=<N>,-w <N>-
uniq-help-check-chars
--count,-c-
uniq-help-count
--ignore-case,-i-
uniq-help-ignore-case
--repeated,-d-
uniq-help-repeated
--skip-chars=<N>,-s <N>-
uniq-help-skip-chars
--skip-fields=<N>,-f <N>-
uniq-help-skip-fields
--unique,-u-
uniq-help-unique
--zero-terminated,-z-
uniq-help-zero-terminated
Examples
Display each line once:
sort {{path/to/file}} | uniq
Display only unique lines:
sort {{path/to/file}} | uniq {{[-u|--unique]}}
Display only duplicate lines:
sort {{path/to/file}} | uniq {{[-d|--repeated]}}
Display number of occurrences of each line along with that line:
sort {{path/to/file}} | uniq {{[-c|--count]}}
Display number of occurrences of each line, sorted by the most frequent:
sort {{path/to/file}} | uniq {{[-c|--count]}} | sort {{[-nr|--numeric-sort --reverse]}}
The examples are provided by the tldr-pages project under the CC BY 4.0 License.
Please note that, as uutils is a work in progress, some examples might fail.