Grep lines before and after matched line

The command grep is really useful for finding matches of a certain word in files or streams. However, until recently I didn’t know how to display lines before and after the matched line(s). Let’s say we have a file named test.txt that contains the following content: ALICE was beginning to get very tired of sitting […]