Use the Unix command, to print duplicate lines
uniq -d filename.txt
sort your input file and you can use the following command to count the duplicates
uniq -c sortedfile.txt

Technical notes, and other ideas.
Use the Unix command, to print duplicate lines
uniq -d filename.txt
sort your input file and you can use the following command to count the duplicates
uniq -c sortedfile.txt