Suppose you have a file that contains IP addresses, one address in each line:
10.0.10.1 10.0.10.1 10.0.10.3 10.0.10.2 10.0.10.1
You need a
I feel awk associative array is also handy in this case
$ awk '{count[$1]++}END{for(j in count) print j,count[j]}' ips.txt
A group by post here