Tailing logs

Jon Radel jon at radel.com
Fri Aug 22 14:55:57 UTC 2008

DAve wrote:
> I would love to have a way to tail a log, like piping to grep, except I
> see every line and the lines I would normally grep for are highlighted.
> That would be cool. Anyone know of a bash command or tool that will do
> this?
> Side note, I am tailing sendmail after changes to my outbound queue
> runners. I want to highlight my sm-mta-out lines but still see all lines.

less <logfile>
/string you care about, regex works

If you do a search a file in less and then start tailing the file inside
less, it continues to highlight all matches for your last search.  While
I'm sure there are other ways of achieving this, this is the one I use
on a regular basis.

--Jon Radel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3283 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20080822/c2cdef2f/smime.bin

More information about the freebsd-questions mailing list