How To Print The Next Line After A Matching Regexp With Sed

- #Tips #Linux -
~ $ cat example.txt
first line
second line
third line
another line

~ $ sed -n '/second/{n;p;}' < example.txt
third line

~ $ sed -n '/second/{n;p;n;p;}' < example.txt
third line
another line