LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   how to capture the line after the matching words (http://www.linuxquestions.org/questions/linux-general-1/how-to-capture-the-line-after-the-matching-words-913639/)

another 1 11-15-2011 08:05 AM

how to capture the line after the matching words
 
Hi,

I have log files and I need to match the lines before and after the matching words, not just the matching line. it would be nice if you could help me.

BR,
Khalid

colucix 11-15-2011 08:08 AM

Take a look at the -B (before) and -A (after) option of grep. Maybe this what you're looking for.

another 1 11-15-2011 08:22 AM

Thanks, this exactly what I was looking for


All times are GMT -5. The time now is 11:22 PM.