# 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
