You're replying to a comment by Jotne.

Jotne Permalink
August 14, 2013, 07:39

Print 2 lines before and 3 after "pattern"

awk '{a[NR]=$0} $0~s {f=NR} END {for (i=f-B;i<=f+A;i++) print a[i]}' B=2 A=3 s="pattern"<\code>
grep -A3 -B2 "pattern"<\code>

Reply To This Comment

(why do I need your e-mail?)

(Your twitter handle, if you have one.)

Type the word "disk_100": (just to make sure you're a human)

Please preview the comment before submitting to make sure it's OK.