Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

tac command in Linux with Examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

tac command in Linux is used to concatenate and print files in reverse. This command will write each FILE to standard output, the last line first. When no file is specified then this command will read the standard input.

Syntax:

tac [OPTION]... [FILE]...

Example: It will print files in reverse.

Options:

  • tac -b: This option attach the separator before instead of after.

    Example:

    tac -b concat.txt tacexample.txt

  • tac -r: This option will interpret the separator as a regular expression.

    Example:

    tac -r concat.txt tacexample.txt

  • tac -s : This option use STRING as the separator instead of newline.

    Example:

    tac -s concat.txt tacexample.txt

  • tac –help : This option will display the help text and exit.
    tac --help

  • tac –version: This option will give the version information and exit.
    tac --version

My Personal Notes arrow_drop_up
Last Updated : 27 May, 2019
Like Article
Save Article
Similar Reads