Query recent command usage records according to .bash_history under Ubuntu

In the Ubuntu system, the commands executed by each user will be saved in the .bash_history file. This file will save hundreds of commands recently used by the user, which can be viewed directly through the cat command.

cat /home/username/.bash_history

In actual use, just replace the username above with the corresponding username.

In addition, you can also view it through the history command.

history

Compared with directly cat history files, the advantage of the history command is that the printout will add line numbers, which looks clearer.

Guess you like

Origin blog.csdn.net/u013685264/article/details/125059122