[Editorial insertion: Possible duplicate of the same poster\'s earlier question?]
Hi, I need to extract from the file:
first second
you could use
$ grep -1 third filename
this will print a string with match and one string before and after. Since "third" is in the last string you get last two strings.