Using awk, I would like to print the last matching line of a file. I would like only the matching line itself, not any range of lines. I can use a command like
awk
reverse the file and find the first match.
tac file | awk '/foo/ {print; exit}'