bash_history
Hi all,
I used history -c command and pressed the up arrow to check if my history has been cleared. Well it has been cleared. Then i opened the bash_history file from my home directory and found that the commands that i typed before are still there. What am I doing wrong here? Please help |
Quote:
To clear the history, you need to do Code:
rm -rf ~/.bash_history Kind regards |
Quote:
If you just want to delete a single file use Code:
rm ~/.bash_history |
cat /dev/null > ~/.bash_history
It's more fun hehe. It basically nulls out the file. |
Code:
>~/.bash_history |
Quote:
Quote:
|
Quote:
|
Why waste a good inode? I say leave the file and just wipe the contents. But yes both have the same result.
|
history -c immediately followed by history -w should solve the issue without removing or redirecting anything. If you want to clear the history file every time you start a new shell session, a history -w statement in $HOME/.bashrc should do the trick.
|
All times are GMT -5. The time now is 02:41 PM. |