Using Tac Command In Linux- Examples

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

tac --help

using tac command to display help details

2: Displaying version details

tac --version

using tac command to display version