-   Linux - Newbie (
-   -   use grep to match multiple lines (

noony123 02-03-2011 03:40 AM

use grep to match multiple lines
Hi all

I have done this before but i cant really recall now

I have a text file and i want to grep the word "interface" and 10 lines following it. I think there was some switch like grep -A or something ?? anyone knows ?

druuna 02-03-2011 03:41 AM


Yep, -A10


grep -A10 "interface" infile
Hope this helps.

grail 02-03-2011 05:47 AM

Try looking at the man page.

All times are GMT -5. The time now is 06:38 AM.