News for hackers. Stuff that matters.
Re:Beyond grep: ack, a code search tool for programmers by ekns on Saturday July 20, 2013 @05:16PM (#6076610)
You could do this with grep or ack or ag:

  grep bar -A 5 -B 5 files... | grep foo
-A n prints n lines following the match (bar) and -B n prints n lines before the match.
Re:Beyond grep: ack, a code search tool for programmers by bencoder on Sunday July 28, 2013 @06:03AM (#6116217)
-C x does the same as both -A x and -B x together

(A - after, B - before, C - context)