I was pecking away commands on the bash command line and, without paying attention, I typed in my password when I thought it was needed for a command. But looking up I saw that I was not getting a password request, but was on the command line. Aside from being thankful that I do not use a valid command for a password, I was concerned that I was leaving my password in plain text in my bash history. My home directory is encrypted, so there is little chance that someone will get access to it, but I wanted to delete it nonetheless.
To view the bash history, type
You will see something like this:
943 mvn install
946 kill 12667
Find the line number of the entry you want to delete—in this case #945—and type:
history -d 945
(Obviously you should replace the 945 with the item number you want to delete!)
historycommand again and you will see that the entry is gone.