I have a log file containing startup and shutdown times for everday.
I want to see the last pattern pattern for startup and shutdown(which is located at the end of the file being updated everyday).
Also I dont want all the lines between the startup and shutdown.I want only few(say 3) lines after the last startup and few(say 3 lines) after the last shutdown.
Any suggestions for a one liner.
less logfile | sed -ne'/startup/,+3p' -e '/shutdown/,+3p'but it did'nt work – munish Nov 14 '11 at 7:40