Clear historical commands recorded in history under Linux

藏色散人
Release: 2020-01-31 17:51:37
forward
3329 people have browsed it

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!

Clear historical commands recorded in history under Linux

1. History

This command can view the history commands used

Clear historical commands recorded in history under Linux

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!

Related labels:
source:oschina.net
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template