#1 Enter last | more in the terminal to view the "Logon/logout/restart" history, including the date and user information. #2 the records of Successful Logon/logout are stored in "/var/log/wtmp", and the records of Logon failures are stored in "/var/log/btmp. To delete logon records, you only need to delete these two files. Method: sudo-iecho & gt;/var/log/wtmpecho & gt;/var/log/btmp #3
#1
Terminal Input
Last | more
You can view the "Logon/logout/restart" history, including the date, user, and other information.
#2
These records of Successful Logon/logout are stored in "/var/log/wtmp", and logon Failure records are stored in "/var/log/btmp. To delete logon records, you only need to delete these two files.
Method:
Sudo-I
Echo>/var/log/wtmp
Echo>/var/log/btmp
#3
To clear the command history, run
History-c
Or
Echo>./. bash_history
[Note], if you want to check it later, back up the history before clearing it. For example, export to a folder and save it for your reference and reference. You can run the following command:
Cat./. bash_history>/home/Bentutu/folder/cmdtxt
Replace "/home/Bentutu/folder/" with your path.