[CentOS] sorting a file
Stephen Harris
lists at spuddy.orgFri Apr 3 10:56:43 UTC 2009
- Previous message: [CentOS] sorting a file
- Next message: [CentOS] sorting a file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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 the seperator is between the columns. If it's a space (as with httpd logs) then cut -d' ' -f1 FILE | sort | uniq -c | sort -n -- rgds Stephen
- Previous message: [CentOS] sorting a file
- Next message: [CentOS] sorting a file
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list