~ $ 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
Tags: Linux/Unix, sed
~ $ 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
Tags: Linux/Unix, sed
No comments
Comments feed for this article
Trackback link: http://lucasforge.2bopen.org/2009/02/how-to-print-the-next-line-after-a-matching-regexp-with-sed/trackback/