bash_history how to delete files

Bash shell in the "~ / .bash_history" ( "~ /" indicates that the user directory) file to save the command used 500, which allows you to enter long commands used easily. Each user has an account in the system has a ".bash_history" files in his directory.

bash shell should store a small amount of command, and regard these historical command to delete each time the user logs off.
The first step:

"/ etc / Profile" "HISTFILESIZE" and "HISTSIZE" determine the number of old-line command bar that can be saved for all users ".bash_history" file in the file. It is strongly recommended to the value "HISTFILESIZE" and "HISTSIZE" line is set to a smaller number of "/ etc / profile" file, such as 30. Edit profile file (vi / etc / profile), read the following line:
HISTFILESIZE = 30
HISTSIZE = 30
This means that each user's ".bash_history" files can only save 30 old commands.

Step two:

should also add the following line "rm -f $ HOME / .bash_history" in "/etc/skel/.bash_logout" file. In this way, every time the user logs off, ". Bash_history" file will be deleted.

Guess you like

Origin www.cnblogs.com/daiyacheng1991/p/11464953.html