2016-01-12 15:08:52 +00:00
|
|
|
# uniq
|
|
|
|
|
2015-12-29 13:00:40 +00:00
|
|
|
> Output the unique lines from the given input or file.
|
2016-01-12 15:08:52 +00:00
|
|
|
|
|
|
|
- Display each line once:
|
|
|
|
|
|
|
|
`uniq {{file}}`
|
|
|
|
|
|
|
|
- Display only unique lines:
|
|
|
|
|
|
|
|
`uniq -u {{file}}`
|
|
|
|
|
|
|
|
- Display only duplicate lines:
|
|
|
|
|
|
|
|
`uniq -d {{file}}`
|
|
|
|
|
|
|
|
- Display number of occurences of each line along with that line:
|
|
|
|
|
|
|
|
`uniq -c {{file}}`
|
2016-07-10 10:26:13 +01:00
|
|
|
|
|
|
|
- Display number of occurences of each line, sorted by the most frequent:
|
|
|
|
|
|
|
|
`uniq -c {{file}} | sort -nr`
|