I'd like to view logfiles with colored output, scrollable and searchable. How do I do that?
I tried less /var/log/syslog | ccze | grep error
, but it is not scrollable.
I'd like to view logfiles with colored output, scrollable and searchable. How do I do that?
I tried less /var/log/syslog | ccze | grep error
, but it is not scrollable.
That's because you're doing it the wrong way around. It's
less
that is scrollable so that needs to be the last command in the pipeline:The options used are:
This makes
ccze
use ANSI color codes instead of curses. Whileless
can deal with ANSI escapes with the-R
option (see below), curses are more of a problem. Using the-A
option ofccze
neatly sidesteps that issue.