How to quickly view history by Linux
This article mainly shows you "Linux how to quickly view historical records", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Linux how to quickly view historical records" this article.
In Linux systems, two keystrokes are commonly used to view history:
Up Arrow: look forward in chronological order for used commands, one command for each press
Down Arrow: look back for used commands in chronological order, advancing one command each time you press.
If you think it takes too much time to enter one command at a time with the arrow keys, you can also use the search method:
Ctrl + R: used to find used commands
For example, if I look up the command date, I can use Ctrl + R, press enter, and then enter only da. Because I have used the command date before, it automatically completes the date command for me, as shown below:
History command
History means "history, historical record" in English.
The command history is used to list all previously used commands, as shown in the following figure:
As you can see, the system automatically saves the 31 commands I have entered in the terminal since I installed Ubuntu, the most recent of which is history.
The history command makes it easy for us to know which commands we have typed before.
Also, the used commands listed by history are numbered, as shown in the figure above. If you want to rerun the corresponding numbered command, you can use! A format like numbering.
For example, in my case,! 30 will run the date command again, because in the screenshot above, we can see the imperative date numbered 30.
The above is all the contents of the article "how to quickly check the History of Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!