apacheのaccess.logからipの逆引き
$ sudo cat /var/log/apache2/access.log | grep -v 127.0.0.1 | grep -v 192.168. | cut -d" " -f1 | sort | uniq > access_ip.txt $ while read line do host $line done < access_ip.txt | cut -d" " -f5 > access_host.txt
各行に対してhostコマンドしたいんだけどやっぱwhile使わなきゃだめなのか?途中のファイルaccess_ip.txtを作るあたりがダサい。