history 清空历史记录 或 history不记录历史命令
生活随笔
收集整理的這篇文章主要介紹了
history 清空历史记录 或 history不记录历史命令
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
# vi ~/.bash_history
清空里面的記錄,并退出當前shell
# exit(一定要退出當前shell)
# history
1 vi ~/.bash_history
2 history |grep mysql
3 clear
4 vi ~/.bash_history
5 echo "" > ~/.bash_history
6 vi ~/.bash_history
7 history
8 exit
9 history
#之前的內容被清空!!!
[root@localhost ~]# history
1 history
2 echo "" > ~/.bash_history
3 history
[root@localhost ~]# history -c #也可以清空歷史命令
[root@localhost ~]# history
1 history
history不記錄歷史命令:
#vi /etc/profile #HISTSIZE=1000 HISTSIZE=6 #記錄歷史命令的條數;HISTSIZE=0為不記錄
記得重新載入:
# source /etc/profile
總結
以上是生活随笔為你收集整理的history 清空历史记录 或 history不记录历史命令的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2023 雨果奖提名作《赛博朋克 207
- 下一篇: 马家滩到毛乌素沙漠多少公里?