Answer by DisgruntledGoat for Count how many times each line appears in a file
I just came here with a similar problem. From this, I managed to put together a slightly more advanced command, which I hope is useful for others.As Steven D said in the comments above uniq only counts...
View ArticleAnswer by Cheng for Count how many times each line appears in a file
I figured it out; one of uniq's options is -c, for "prefix lines by the number of occurrences":$ uniq -c
View ArticleCount how many times each line appears in a file
Say I have a file which contains:AAABCCI want to have the output like this:A 3B 1CC 1
View Article
More Pages to Explore .....