Name

tac

Synopsis

tac [options] [file]

Named for the common command cat, tac prints files in reverse to standard output. Without a filename or with -, it reads from standard input. By default, tac reverses the order of the lines, printing the last line first.

Options

-b, --before

Print separator (by default a newline) before the string it delimits.

-r, --regex

Expect separator to be a regular expression.

-s string, --separator=string

Specify alternate separator (default is newline).

--help

Print a help message and then exit.

--version

Print version information and then exit.

Get Linux in a Nutshell, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.