the box locks up !

John Macdonald jmm-TU2q2He6PgRlD5gtYiU6kEEOCMrvLtNR at public.gmane.org
Wed Feb 4 06:00:30 UTC 2004


On Tue, Feb 03, 2004 at 06:29:00PM -0500, Byron Sonne wrote:
> If anyone has a quickie to grep for certain errors *and* display, let's 
> say, the 25 lines before and after the errors it greps out, that would 
> be handy.

While the context option to grep has been suggested as
the direct answer to your question, I tend to use less
on the file myself.  It has regular expression search
capability to look for the interesting parts, and you
can use its forward and backward paging capabilities
to examine the amount of context that is right for the
particular query.  Reverse search is often useful too.
(When was the previous time that this process ID was
mentioned?)  A grep with context will almost always be
too much or too little context, but it does have the
advantage of finding all of the matches in one shot.
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list