~ $ 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

Experiments from the land of open source
You are currently browsing the monthly archive for February 2009.
~ $ 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