[CentOS] sorting a file

2009-04-03 Thread Tom Brown
I need to find out how many times an IP address appears in a file - the IP is the first field in the access log string so what would be the best way to sort this file and count how many times each IP address appears ? thanks ___ CentOS mailing list

Re: [CentOS] sorting a file

2009-04-03 Thread Stephen Harris
On Fri, Apr 03, 2009 at 11:50:46AM +0100, Tom Brown wrote: I need to find out how many times an IP address appears in a file - the IP is the first field in the access log string so what would be the best way to sort this file and count how many times each IP address appears ? Depends on what

Re: [CentOS] sorting a file

2009-04-03 Thread John Doe
From: Tom Brown t...@ng23.net I need to find out how many times an IP address appears in a file - the IP is the first field in the access log string so what would be the best way to sort this file and count how many times each IP address appears ? grep ^IP | wc -l JD

Re: [CentOS] sorting a file

2009-04-03 Thread John Doe
From: Tom Brown I need to find out how many times an IP address appears in a file - the IP is the first field in the access log string so what would be the best way to sort this file and count how many times each IP address appears ? grep ^IP | wc -l Oops, replied too quickly...

Re: [CentOS] sorting a file

2009-04-03 Thread Alfred von Campe
I need to find out how many times an IP address appears in a file - the IP is the first field in the access log string so what would be the best way to sort this file and count how many times each IP address appears ? I always solve a problem like this with a small Perl script. It

Re: [CentOS] sorting a file

2009-04-03 Thread Tom Brown
Oops, replied too quickly... missed the 'each IP' go for Stephen solution ^_^ yeap - thanks both ___ CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos