1、当前session执行的命令,放置缓存中,执行exit时,把缓存信息写入~/.bash_history

2、当session直接被kill时,缓存中的历史命令不会写入~/.bash_history

3、正确清空当前用户的history的方法

>~/.bash_history
history -c    #清空当前缓存中的命令
exit    #关闭shell连接,可以避免写入~/.bash_history
#执行exit,会把该命令记录到~/.bash_history文件去

  

  

相关文章:

  • 2022-12-23
  • 2022-03-06
  • 2022-12-23
  • 2021-05-27
  • 2021-12-02
  • 2021-12-02
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-30
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案