标签:awk
access.log:
192.168.1.247 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.246 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.245 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.243 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.247 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.247 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.245 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.246 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.246 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.247 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.245 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.245 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.246 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.243 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
192.168.1.247 - - [02/[ul/2015:23:44:59 [0800] "GET /[HTTP/1.1 200 19"
答案:
[wangyuanyuan@vpn shell]$ awk ‘{print $1}‘ access.log |sort -n|uniq -c|sort -rn|head
5 192.168.1.247
4 192.168.1.246
4 192.168.1.245
2 192.168.1.243
本文出自 “linux” 博客,转载请与作者联系!
标签:awk
原文地址:http://warm51fun.blog.51cto.com/3884274/1893742