Originally Posted by verdeboy2k
they are stored in the file ~/.bash_history
Or in ~/.history, depends on the shell. Just being a Pedantic Ass(TM).
Bash shell command 'history -w' will write out the current history list to the history file. When you're in the shell the history list is stored in memory and isn't written to the file until a logout.
Force the write with the above command.