Linux

‘tail -f’ with highlight

This is an example of how you can use tail with colors. # tail -f /var/log/maillog | perl -pe ‘s/colorthisword/\e[1;32;40m$&\e[0m/g’ The ;;; values explained 0 all attributes off 1 bold 32 foreground green 40 background black “colorthisword” can be any perl regular expression: (foo|bar) highlight the strings foo and bar \b((foo|bar)\b highlight the words foo […]

Read More