in reply to opinion - enormous input files
sort file | uniq -c [download]
perl -e 'print `sort file | uniq -c`' [download]