tac - reverse file cat

SYNOPSIS

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.


EXAMPLE
Show all of today's web server hits from the log, since midnight. Note that 13/Apr/1999 is yesterday's date:

tac -e '13/Apr/1999' /usr/local/httpd/logs/transfer.log


SEE ALSO
The Vortex readln function


Copyright © Thunderstone Software     Last updated: Dec 10 2018
Copyright © 2019 Thunderstone Software LLC. All rights reserved.