Home >Operation and Maintenance >Linux Operation and Maintenance >Clear historical commands recorded in history under Linux
The following column Linux Tutorial will introduce to you how to clear the historical commands recorded in the history in the Linux environment. I hope it will be helpful to friends in need!
1. History
This command can view the history commands used
2. History -c
This command and parameters can clear the history command record
View again
The command record is empty
Remarks: Knowledge expansion
This command only deletes the command records of the current user and will not delete those of other users.
In fact, these records are in files similar to .bash_history in the current user's home directory. Of course, it depends on what shell you use.
For example: vim ~/.bash_history
Open the historical command record file under the current user.
cat
or vim ~/.bash_history
View the contents of the file
The above is the detailed content of Clear historical commands recorded in history under Linux. For more information, please follow other related articles on the PHP Chinese website!