tac command in Linux is basically the reverse of cat command. Means, using this command allows users to display the file in reverse order to standard output. In case if no file is specified while using this command, it will read the standard output.
Syntax of tac Command in Linux
tac [Options] [File_Name]
Options available to use with tac
- -b: Used for attaching separator before instead of after.
- -r: Used for interpreting the separator as regular expression.
- -s: Allows to use STRING as the separator.
- –help: Displays help information and exits.
- –version: Displays version information and exits.
Examples of tac command
1: Displaying help information
2: Displaying version details