Bash command 'history -c ' won't works properly(?)

I noticed that the command ’ history -c ’ for cleaning the bash history works only on the instance opened.
But if I close it and I reopen the terminal, here comes the history again.
Is that an issue?

I don’t know, but you can use it rm ~/.bash_history . See https://www.cyberciti.biz/faq/clear-the-shell-history-in-ubuntu-linux/
.bash_history simple text file, can also be got rid of by renaming.

2 Likes

Try deleting file ~/.bash_history.

1 Like

That’s for you to decide…
If you want to write that empty history to disk use

$ history -w

afterwards.

2 Likes

To clear bash history i type:

history -c && history -w

or

cat /dev/null > ~/.bash_history

2 Likes

@freggel.doe
@Melways

Thanks guys! I was thinking that simply digiting ’ history -c ’ makes the whole work.

1 Like