tail -f with highlighting

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.

Tags:

Leave a Reply