counting words

if i have a long list of data, with every line beginning with an ip-address, like this:

62.165.8.187 - - [24/Oct/2002:23:13:42 +0200] "GET /bestandnaam.html HTTP/1.1" 200 5848 "http://www.domeinnaam.nl/bestandnaam.html" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"

how do i count which ip-adresses are mentioned the most?

i don't know which ip-adresses to search so i can't give an input how many times a specific word is mentioned, i just want to know which are mentioned the most.

An example how it could be done:

$> cat infile
11.4.1.31
10.10.10.1
10.123.1.5
10.10.10.1
10.123.1.5
11.4.1.31
10.10.10.1
11.43.1.30
9.30.111.7
11.43.1.30
11.4.1.31
9.30.111.7
11.4.1.31
11.4.1.31
10.123.1.5
$> awk '{_[$1]+=1} END{for(a in _){print a,_[a]}}' infile| sort -t" " -k2,2r
11.4.1.31 5
10.10.10.1 3
10.123.1.5 3
11.43.1.30 2
9.30.111.7 2

Check with this one

awk '{ print $1 }' | sort | uniq -c  /path/to/logfile.log

chakrapani probably meant:

# Top 10 occurances of IP address
awk '{print $1}'  /path/to/logfile.log | sort | uniq -c | sort -n -r | head -10