command | format_command |sort |uniq -c |sort -nr

みたいな。

zcat /var/log/httpd/access_log*|awk -F' ' '{print $1}'|sort |uniq -c |sort -nr


[ 出現回数 IPアドレス ]
と上から出現順位に出力される。
| sort | uniq -c | sort -nr が便利ということ。
なんでわざわざawk使ってるかと言えば、cutの切り出し方がいまいちわからないから。

© 2012 # watch -d tail /var/log/ngsw.log Suffusion theme by Sayontan Sinha