Include -A flag to add lines after match grep match -A 3 #display match line and 3 after lines
#Combine grep and tail for grepping until second match and filtering #last with tail command grep -m2 "two" in-file.txt | tail -n1
awk 'c&&!--c;/pattern/{c=N}' file