用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 |