I seem to have discovered that the ~/.bash_history
file doesn't contain what is displayed when you use the up arrow. I found this by doing a command like so
smbclient -L 10.2.10.240 -umyuser -p"mypassword on the command line is bad"
This command is actually wrong, it has a mistake, the -u
is actually supposed to be a -U
and so this command failed.
However I also realized that that was bad to do, because it puts your password into the history, I went into .bash_history
and what was interesting was that it doesn't have the mistake. It only has
smbclient -L 10.2.10.240
and that's it. But this is were it gets weird, if you use the up arrow the whole command including mistakes is there for you to edit.
So the question is, why is there a difference between what is in .bash_history
and what the up arrow displays? Where does the up arrow data live?
Before you point it out; it's quite convenient in this case because it prevents my password from being saved, but, that's not why it's doing this, I also tested it with correct options and then it does save the whole command including passwords and all.