Q:

How to get the count of duplicate strings in a set using grep, uniq and awk in unix?

I have a very large set of strings, one on every line of a file. Many strings occur more than one times in the file at different locations. 
I want a frequency count of the strings using unix commands like awk, grep, uniq and so on. I tried few combinations but it didn't work.
what is the exact command to get the frequency count?

A:

To count the occurrences of lines in a file the simplest thing to do is: 
$ sort file | uniq -c 

