Uploaded October 2025 | Updated November 2026, 1 day ago
The 'uniq' command is used to print or omit repeated lines of text.
- Display each line once (duplicate lines printed only once):
sort path/to/file | uniq
- Display only unique lines (duplicate lines not printed at all):
sort path/to/file | uniq -u
- Display only duplicate lines (duplicate lines printed only once):
sort path/to/file | uniq -d
- Display only duplicate line and count number of occurrences of each line:
sort path/to/file | uniq -cd
- Compare no more than 5 characters in lines:
sort path/to/file | uniq -w 5
- Avoid comparing the first 5 characters in lines:
sort path/to/file | uniq -s 5
REFERENCED:
βΊ gitlab.com/dwt1/vidman
WANT TO SUPPORT THE CHANNEL?
π° Patreon: patreon.com/distrotube
π³ Paypal: paypal.com/donate/?hosted_button_id=MW3ZFGS8Q9JGW
ποΈ Amazon: amzn.to/2RotFFi
π Teespring: teespring.com/stores/distrotube
DT ON THE WEB:
πΈοΈ Website: http://distro.tube
π GitLab: gitlab.com/dwt1
π¨οΈ Mastodon: fosstodon.org/@distrotube
π« Reddit: reddit.com/r/DistroTube
π½οΈ Odysee: odysee.com/@DistroTube:2
FREE AND OPEN SOURCE SOFTWARE THAT I LIKE:
π Brave Browser - brave.com
π½οΈ Open Broadcaster Software: obsproject.com
π¬ Kdenlive: kdenlive.org
π¨ GIMP: gimp.org
π» VirtualBox: virtualbox.org
ποΈ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!
The 'uniq' command is used to print or omit repeated lines of text.
- Display each line once (duplicate lines printed only once):
sort path/to/file | uniq
- Display only unique lines (duplicate lines not printed at all):
sort path/to/file | uniq -u
- Display only duplicate lines (duplicate lines printed only once):
sort path/to/file | uniq -d
- Display only duplicate line and count number of occurrences of each line:
sort path/to/file | uniq -cd
- Compare no more than 5 characters in lines:
sort path/to/file | uniq -w 5
- Avoid comparing the first 5 characters in lines:
sort path/to/file | uniq -s 5
REFERENCED:
βΊ gitlab.com/dwt1/vidman
WANT TO SUPPORT THE CHANNEL?
π° Patreon: patreon.com/distrotube
π³ Paypal: paypal.com/donate/?hosted_button_id=MW3ZFGS8Q9JGW
ποΈ Amazon: amzn.to/2RotFFi
π Teespring: teespring.com/stores/distrotube
DT ON THE WEB:
πΈοΈ Website: http://distro.tube
π GitLab: gitlab.com/dwt1
π¨οΈ Mastodon: fosstodon.org/@distrotube
π« Reddit: reddit.com/r/DistroTube
π½οΈ Odysee: odysee.com/@DistroTube:2
FREE AND OPEN SOURCE SOFTWARE THAT I LIKE:
π Brave Browser - brave.com
π½οΈ Open Broadcaster Software: obsproject.com
π¬ Kdenlive: kdenlive.org
π¨ GIMP: gimp.org
π» VirtualBox: virtualbox.org
ποΈ Doom Emacs: github.com/hlissner/doom-emacs
Your support is very much appreciated. Thanks, guys!










