I accidentally put a password on the command line and needed to clear Bash shell history. That was easy enough with
echo "" > ~/.bash_history.
I added the same to my
.bash_logout just in case for the future. However, when I check history after a logout/logon, the last command I entered is still present in the history file. More correctly, two commands are present: the last command I entered, and the
exit command from the logout.
How do I make Bash flush the command history to file so that I can clear it upon logout?