tac – reverse file cat 

tac – reverse file cat

tac [options] file […]

DESCRIPTION
The tac program prints the given files, but starting from the end of file, in reverse line order. It is useful for quickly examining the last few lines of a log file in most-recent order. Available options are:

-s startexpr Start printing at the first line that matches the given REX expression. By default tac will start printing with the last line of the file.
-e endexpr End printing with the first line that matches the given REX expression. By default tac will print until the start of the file is reached. Note: Since tac reads the file backwards by default, the startexpr will occur after the endexpr in the original file, even though it appears first in the output.
-n lines Read at most this many lines from the file. This includes any lines read but not printed before the startexpr matches. It is a “safety limit” to avoid reading through all of a very large log file if the start or end expressions are not found.
-f Read forward from the start of the file (like cat) instead of backwards from the end.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s