Grep -A1 how to show only next line after the matched one

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

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.

Answers

you can try with awk:

awk  /blah/{getline; print}  logfile

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/7451423/grep-a1-how-to-show-only-next-line-after-the-matched-one

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils