用history命令就行,具体格式:
[root@linux ~]# history [n]
[root@linux ~]# history [-c]
[root@linux ~]# history [-raw] histfiles
参数:
n :数字,意思是‘要列出最近的 n 笔命令列表’的意思!
-c :将目前的 shell 中的所有 history 内容全部消除
-a :将目前新增的 history 指令新增入 histfiles 中,若没有加 histfiles ,
则预设写入 ~/.bash_history
-r :将 histfiles 的内容读到目前这个 shell 的 history 记忆中;
-w :将目前的 history 记忆内容写入 histfiles 中!
history
man history
本文详细介绍Linux环境下使用history命令的各种高级技巧,包括查看、清除、保存和读取历史命令记录的方法。掌握这些技巧能够显著提高你的工作效率。

被折叠的 条评论
为什么被折叠?



