Show lines below and/or above a match with grep
$ grep pattern file.s -A n
n lines of trailing context after each match.
$ grep pattern file.s -B n
n lines of leading context before each match.
$ grep pattern file.s -C n
n lines of leading and trailing context surrounding each match.
$ man grep.
grep is copyleft-licensed and is maintained by Jim Meyering1. It was first released in 1973.
GNU Grep official website.↩︎