sat*_*ish 10 bash redhat-enterprise-linux
我已经使用#history -c 清除了终端中的所有历史记录。现在我想恢复我所有被清除的命令。请给我一个答复
Dav*_*ill 11
history -c将~/.bash_history在该外壳中清除。
bash不会立即将历史记录刷新到~/.bash_history.
~/.bash_history直到您使用history -w.
如果你真的想清除你需要history -cw在所有打开的 shell 中使用的历史记录。
history -w您可以使用 重新加载历史记录history -r。
如果您注销并再次登录,您的历史记录也将被恢复。
history -w在一个 shell 中使用并且您打开了其他 shellhistory -w(尽管它与另一个 shell 的历史记录不同)history -candhistory -w| 归档时间: |
|
| 查看次数: |
22615 次 |
| 最近记录: |