1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-04-29 23:24:55 +02:00
tldr/pages/common/uniq.md

24 lines
404 B
Markdown
Raw Normal View History

2016-01-12 10:08:52 -05:00
# uniq
> Output the unique lines from the given input or file.
2016-01-12 10:08:52 -05: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}}`
- Display number of occurences of each line, sorted by the most frequent:
`uniq -c {{file}} | sort -nr`