IT Questions and Answers :)

Friday, August 10, 2018

In Linux system, which command will print the output of log file in reverse ?

In Linux system, which command will print the output of log file in reverse ?

  • less
  • cat
  • tac
  • rcs 

 
In Linux system, which command will print the output of log file in reverse ?

EXPLANATION

Let's assume that we have a log file named "Letters" that contains: A B C D (in separate lines).
To view the content of the log file in Linux terminal, the command will be:
linux@machine:~$ sudo cat Letters
And we will get the output:
A
B
C
D

To view the content of the log file in reverse, the command will be:
linux@machine:~$ sudo tac Letters
And we will get the output:
D
C
B
A




SOURCE

https://www.tecmint.com/learn-linux-cat-command-and-tac-command/
Share:

Popular Posts