history -w history.txt 這樣就能夠把歷史記錄直接顯示在文本中bash
其次歷史記錄的最大行數顯示:變量
[root@cnsz142728 ~]# wc -l ~/.bash_history 1999 /root/.bash_history 運行一次 export HISTFILESIZE=1000,並加入全局變量中,/etc/profile中添加改行file