Linux common commands-19: history

The history command is used to display the historical commands executed by the user before, and can also perform operations such as appending and deleting historical commands. History commands will be written to the local file ~/.bash_history .

Syntax format: history [parameter] [directory]

Common parameters:

Example

 # 显示所有历史命令history # 显示最近5条历史命令,包括本条history命令在内history 5 # 清空历史命令history -c # 将当前Shell会话的历史命令追加到命令历史文件中history -a

This article is reprinted from https://xugaoxiang.com/2022/06/04/linux-cmds-19-history/
This site is for inclusion only, and the copyright belongs to the original author.

Leave a Comment