SPACEIO ~ LINUX  Command of the Day #10

sort | uniq -c: let the terminal count for you

Which line shows up most? Let the terminal count.

sort file.txt | uniq -c | sort -nr

What it does

sort puts lines in order, uniq -c counts repeats, and sort -nr ranks them from highest to lowest.

Why it matters

Run it on a log of login attempts and the most frequent source jumps to the top. It's a quick way to spot something unusual.

Try it

Try it on any text file. What is the top result? Share what you found in the community.