清除登錄系統成功的記錄bash
[root@localhost root]# echo > /var/log/wtmp //此文件默認打開時亂碼,可查到ip等信息ide
[root@localhost root]# last //此時即查不到用戶登陸信息spa
清除登錄系統失敗的記錄orm
[root@localhost root]# echo > /var/log/btmp //此文件默認打開時亂碼,可查到登錄失敗信息ip
[root@localhost root]# lastb //查不到登錄失敗信息it
清除歷史執行命令ast
[root@localhost root]# history -c //清空歷史執行命令class
[root@localhost root]# echo > ./.bash_history //或清空用戶目錄下的這個文件便可登錄
導入空歷史記錄亂碼
[root@localhost root]# vi /root/history //新建記錄文件
[root@localhost root]# history -c //清除記錄
[root@localhost root]# history -r /root/history.txt //導入記錄
[root@localhost root]# history //查詢導入結果
example
[root@localhost root]# vi /root/history
[root@localhost root]# history -c
[root@localhost root]# history -r /root/history.txt
[root@localhost root]# history
[root@localhost root]# echo > /var/log/wtmp
[root@localhost root]# last
[root@localhost root]# echo > /var/log/btmp
[root@localhost root]# lastb
[root@localhost root]# history -c
[root@localhost root]# echo > ./.bash_history
[root@localhost root]# history