
在 Linux 系统上,bash shell 的 history 命令可以方便地回顾和重用命令,但是你要控制它记住多少,忘记多少,有很多事情要做。

Bash 的 history 命令在它提供的功能数量上超过了所有其他 Linux Shell 历史接口。

用强大的 history 命令使你的命令行提示符更有效率。

fc 是个 shell 内置命令,用于在交互式 shell 里列出、编辑和执行最近输入的命令。

默认情况下 history 命令直接显示用户执行的命令而不会输出运行命令时的日期和时间,即使 history 命令记录了这个时间。

Linux 新手往往对命令行心存畏惧。部分原因是因为需要记忆大量的命令,毕竟掌握命令是高效使用命令行的前提。不幸的是,学习这些命令并无捷径,然而在你开始学习命令之初,有些工具还是可以帮到你的。

每个命令相关的日期和时间可以记录到历史文件中,用 HISTTIMEFORMAT 环境变量的设置作为命令历史的备注记录。