cut
- cut テキスト・ファイルの各行から文節を取り出す
- http://homepage2.nifty.com/cs/linux_command/command/cut.html
むちゃくちゃ便利。
こんな具合に使ってみた。
sed '/^192.168.1.66/d ' /var/log/httpd/access_log | cut -d' ' -f1-5 | tail -f
httpアクセスログを読み込んで、自分のIP以外からのアクセスがあったら、IPとその時間をズンズンだし続ける命令。
便利すぎ