Linux: View all the lines in a file after a starting delimiter

I need to print all the lines in a text file after a certain time. You can do this pretty easily with a Perl one-liner:

perl -nE 'if (/13:00/) { $found = 1; next } print if $found' /var/log/messages

The delimiter needs to be in the file to trigger. If there was no line that matches 13:00 nothing will print.

Update: This can also be accomplished with awk:

awk '/13:00/ {found=1; next} found' /var/log/messages
Tags:
Leave A Reply
All content licensed under the Creative Commons License