Skip to content

Instantly share code, notes, and snippets.

@sousk
Created January 17, 2011 00:30
Show Gist options
  • Select an option

  • Save sousk/782303 to your computer and use it in GitHub Desktop.

Select an option

Save sousk/782303 to your computer and use it in GitHub Desktop.
colorize screen log
エンジニアの人って割と白黒のログ眺めてる人が多い気がしますが、僕は何かと色つけたい派ですね。
bash に
ctail(){ tail -f $1 | perl -pe 's/'$2'/\033\[1;35m$&\033\[0m/gi'; }
と書いて
ctail /var/log/system.log "(error|exception|unable)"
とかやってます
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment