Whenever you logout or exit from the Bourne Again SHell the contents of your command history are saved in the file .bash_history in your home directory.
When you next login the contents of this file are placed in the history list and you can re-use commands from your previous login session.
To specify how much of your command history is to be saved set the environment variable HISTFILESIZE. For example:
This saves the previous twenty-five (25) commands you have used; not the complete command history list.