Skip to main content
Kill -9 Club
Sign in

uniq

TextPackage: coreutils

Removes adjacent repeated lines, or with -c counts them. It sees only neighbours: sort | uniq -c is the pair, and uniq alone on an unsorted file removes nothing.

What its options do in the lessons

From the same glossary the lessons render under their commands, so the two cannot disagree.

uniq -c
Prefixes each line with the number of times it occurred. uniq only groups adjacent lines, so it goes after a sort.

Lessons that teach it