Linux console count number of occurences using sort and uniq

The quick answer is:

Here is a more indepth version. We have a text file called warframe.txt and want to count duplicate occurences of each line.

We have to create an output stream, sort this stream and use uniq with parameter c to each occurence.


count unique occurences in file on command line - animated gif

(170 Posts)

20 years of coding and working as software engineer but I am still eager to learn more. I am very passionate when it comes to open source, Linux and Java. But I made my peace with Windows long ago to fully enjoy my PC gaming hobby. I have a soft spot for 90s electronic music and Babylon 5. In the evenings you will find me roaming the endless space in Warframe (IGN k05h).