‘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

“colorthisword” can be any perl regular expression:

Colors
This vector holds the colors used for SGR control sequences parameters 30 to 37 (foreground colors) and 40 to 47 (background colors).

Parameter

Note
This only works on ANSI terminals