history 清空历史记录 或 history不记录历史命令
生活随笔
收集整理的這篇文章主要介紹了
history 清空历史记录 或 history不记录历史命令
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
# vi ~/.bash_history
清空里面的記錄,并退出當(dāng)前shell
# exit(一定要退出當(dāng)前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
#之前的內(nèi)容被清空!!!
[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 #記錄歷史命令的條數(shù);HISTSIZE=0為不記錄
記得重新載入:
# source /etc/profile
總結(jié)
以上是生活随笔為你收集整理的history 清空历史记录 或 history不记录历史命令的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 2023 雨果奖提名作《赛博朋克 207
- 下一篇: luogu-单调队列/单调栈专题