How to view the History in Linux














































How to view the History in Linux



The history of a Linux terminal can be viewed using the History command. The history command is used to view the previously executed commands in the terminal. 

Syntax:




Here, the number (known as event number) preceded by every command depends on the system. 

To show a limited number of commands previously executed, the following syntax can be used:




To know how many times a particular command has been executed before, we can use history with grep command.




The most recent command along with its output can be viewed using the !! command.


A particular command can be deleted from history using the -d option.



To delete the whole history, the -c option is used.





Comments