Concatenate and print files in reverse line by line
tac [OPTION]... [FILE]...
-, it reads from standard input.FILE (optional): One or more files to process.
-b, --before Attach the separator before rather than after.
-r, --regex Treat the separator as a Basic Regular Expression (BRE).
-s, --separator=STRING Use STRING as the separator instead of the default newline.
--help Display help and exit.
--version Display version information and exit.
Returns success unless invalid options or parameters are provided.
# Reverse a file character by character (example from info docs):
tac -r -s 'x\|[^x]' test.log
# About the -b option:
seq 1 3 | tac
# Output
3
2
1
# Using the -b option:
seq 1 3 | tac -b
# Output (note there is no newline after 21)
3
21
# The first example converts '1\n2\n3\n' to '3\n2\n1\n'
# The second example converts '1\n2\n3\n' to '\n\n3\n21'
GNU coreutils package. See man -s 1 tac or info coreutils 'tac invocation' for more information.REGULAR EXPRESSIONS section in man -s 1 grep.