tac command in Linux with Examples
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
Recommended Posts:
- mv command in Linux with examples
- ZIP command in Linux with examples
- man command in Linux with Examples
- ar command in Linux with examples
- rev command in Linux with Examples
- help Command in Linux with examples
- last command in Linux with Examples
- tty command in Linux with examples
- tee command in Linux with examples
- ip command in Linux with examples
- more command in Linux with Examples
- fc Command in Linux with Examples
- gdb command in Linux with examples
- arp command in Linux with examples
- cpp command in Linux with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.









