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'd have done it like this:
perl -e 'while (<>) {chop; $h{$_}++;} for $k (keys %h) {print "$k $h{$k}\n";}' ip_addresses
but uniq might work for you.