Print only lines that appear more than once.
Section: sort and uniq
Show duplicate lines only
bash
bash
sort file.txt | uniq -dExplanation
Great for spotting repeated entries or duplicates in lists.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing sort and uniq