How to show only next line after the matched one

awkgrepsed

grep -A1 'blah' logfile

Thanks to this command for every line that has 'blah' in it, I get the output of the line that contains 'blah' and the next line that follows in the logfile. It might be a simple one but I can't find a way to omit the line that has 'blah' and only show next line in the output.

Best Answer

you can try with awk:

awk '/blah/{getline; print}' logfile