mirror of
https://gitea.com/mcereda/oam.git
synced 2026-02-09 05:44:23 +00:00
37 lines
581 B
Markdown
37 lines
581 B
Markdown
# The `uniq` command
|
|
|
|
## Table of contents <!-- omit in toc -->
|
|
|
|
1. [TL;DR](#tldr)
|
|
1. [Sources](#sources)
|
|
|
|
## TL;DR
|
|
|
|
```sh
|
|
# Print all but duplicates lines.
|
|
uniq path/to/file
|
|
|
|
# Only print unique lines.
|
|
uniq -u path/to/file
|
|
|
|
# Only print repeating lines.
|
|
uniq -d path/to/file
|
|
|
|
# Count unique lines only.
|
|
uniq -cu path/to/file
|
|
|
|
# Count duplicated lines only.
|
|
uniq -cd path/to/file
|
|
```
|
|
|
|
## Sources
|
|
|
|
- [The essential Bash cheat sheet]
|
|
|
|
<!--
|
|
References
|
|
-->
|
|
|
|
<!-- Others -->
|
|
[the essential bash cheat sheet]: https://betterprogramming.pub/the-essential-bash-cheat-sheet-e1c3df06560
|