1
I often use tail -f | grep someregex
on log files. I have grep liased to grep ---color=auto
so my matches are highlighted. If I want to see my matches in the context of the whole stream, how would I go about that? Essentially, I want to use tail + grep as a highlighter.
1Could you please clarify? What do you mean by the whole stream? If you want the whole stream, just don't use
tail
, rungrep somepattern
directly. Could you give an example of the kind of process you are monitoring? – terdon – 2013-11-13T19:49:15.847if I am tailing a log file, grepping on error messages, but want to see it in context of some debug messages leading up to that match, in real time. – Pete – 2013-11-13T19:54:00.157