grep -A 2 "searchText" mytext.txt ## next 2 lines after match line grep -B 2 "seacrchText" mytext.txt ## next 2 lines before match line grep -C 2 "searchText" mytext.txt ## next 2 lines before and after match line