Re: Grep: show me this line and the next N lines?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]





On Mon, May 30, 2011 at 5:08 PM, Dotan Cohen <dotancohen@xxxxxxxxx> wrote:
Can grep show the matching lines and the next N lines after a match?
 
I would ideally grep on "[Tag h1]" and have grep display the match and
the next 5 lines so that I see all the content of the h1 section.

Try 

grep -A 5 pattern filename 

M
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux