Posts Tagged ‘tail -f’

tail -f with highlighting

Monday, October 5th, 2009

Use

tail -f /path/to/my.log | perl -p -e 's/(KEYWORD_1|KEYWORD_2)/\033[7;1m$1\033[0m/g;'

to highlight all occurences of KEYWORD_1 and KEYWORD_2 in tail -f.