歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux命令 >> Linux系統下history命令的記錄如何刪除

Linux系統下history命令的記錄如何刪除

日期:2017/2/28 10:03:26   编辑:Linux命令
Linux命令   history命令的記錄如何刪除?
 
  1、修改/etc/profile將HISTSIZE=1000改成0或1
 
  清除用戶home路徑下。bash_history
 
  2、立即清空裡的history當前歷史命令的記錄
 
  history -c
 
  3、bash執行命令時不是馬上把命令名稱寫入history文件的,而是存放在內部的buffer中,等bash退出時會一並寫入。
 
  不過,可以調用'history -w'命令要求bash立即更新history文件。
 
  history -w
 
Copyright © Linux教程網 All Rights Reserved