Tail a log and colour only what matters

Bash

Follows a growing file and highlights errors and warnings, leaving the rest readable but quiet.

tail -F /var/log/app.log \
  | grep --line-buffered -E 'ERROR|WARN' \
  | sed -u 's/ERROR/\x1b[31m&\x1b[0m/'

More in Shell

Random picks