3

Linux常用命令-19:history

 1 year ago
source link: https://xugaoxiang.com/2022/06/04/linux-cmds-19-history/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

history 命令用于显示用户以前执行过的历史命令,还能对历史命令进行追加和删除等操作。历史命令会被写入本地文件 ~/.bash_history 中。

语法格式: history [参数] [目录]

常用参数:

82433d1adbb286ff.png
# 显示所有历史命令
history

# 显示最近5条历史命令,包括本条history命令在内
history 5

# 清空历史命令
history -c 

# 将当前Shell会话的历史命令追加到命令历史文件中
history -a

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK