The tac command is the reverse of the cat command, and its action is to reverse the order of lines in a file. This means that the first line becomes the last line, and the last line becomes the first line.
The syntax of the tac command is as follows:
tac [OPTIONS] [FILE] .
Some common options for the tac command include:
$ seq 1 5 | tac ←Reverse the sequence 1 to 5 5 4 3 2 1 $ tac file ←Read a file in reverse order |