grep -A 2 "app" mytext.txt //prints two lines after the match line grep -B 2 "app" mytext.txt //prints two lines before the match line