[Editorial insertion: Possible duplicate of the same poster's earlier question?]
Hi, I need to extract from the file:
using the grep command, the following line:
How should the grep command look like?
Instead of grep, you can use pcregrep which supports multiline patterns
pcregrep -M 'second\nthird' file
-M allows the pattern to match more than one line.