Just to clarify what they do
Code:
$ cat file
first line
second line
third line
Code:
$ grep -A 1 second file
second line
third line
Code:
$ grep -B 1 second file
first line
second line
Here's a small example (not the best of examples but it works)
Code:
$ cat /var/lib/pacman/local/zip-2.32-1/desc
%NAME%
zip
%VERSION%
2.32-1
Code:
$ grep -A 1 %NAME% /var/lib/pacman/local/zip-2.32-1/desc|tail -1
zip
Of course awk does this better, but I can't think of any examples right now