1.统计ip访问量前10的 ip地址
cat access.log | awk ‘{print $1}‘ | sort | uniq -c | sort -nr | head -n 10
2.查看当天ip访问量统计
cat access.log |grep "21/Apr/2016" |awk ‘{print $1}‘|sort|uniq -c|sort -nr
3.查看访问前10的页面统计
cat access.log | grep "21/Apr/2016" | awk ‘{print $7}‘ | sort | uniq -c | sort -nr | head -n 10
4.查看当天访问次数最多的时间段
tail -n 1000 access.log | awk ‘{print $4}‘|cut -c 14-21 |sort|uniq -c|sort -rn|head -10|more
本文出自 “james” 博客,请务必保留此出处http://lizhuan.blog.51cto.com/8099531/1766242
原文地址:http://lizhuan.blog.51cto.com/8099531/1766242