Tags

, , ,

This little utility is a wonder. It lets you highlight items in text files or other text streams, using regular expressions and multiple configurations. I’ve seen other highlighting utilities, but none offer the flexibility of the remark program (short for regex-markup).

Unfortunately, it hasn’t been updated in two years – but it doesn’t really need it. The current Debian package works fine on Ubuntu. The utility was written by Oskar Liljeblad.

For example, the Debian package comes preconfigured for text output from diff, make, ping, traceroute, and syslog. The regular expressions are the same as used in regex(7) and the syntax for creating the rules files is very flexible and is explained well in the man pages for remark(1).

When looking at highlighted output such as remark puts out (as well as others) you’ll want to utilize the -R (raw) option to less. I use the command


less -RSXmg

With a preconfigured ruleset, you can change the foreground and background colors of anything you can match with a regular expression.

This becomes very useful when you want to scan a lot of text for certain output on a regular basis: things that are not all that important – but that you don’t necessarily want to leave out – can be left in with an appropriate color scheme so that the more important stuff isn’t missed.

Unfortunately, this tool is almost unheard of and is always a pain for me to relocate – but now I won’t lose it again! Give it a try and see if you like it. Kudos to Oskar for a beautiful package!

Advertisements