Here is a great way to preserve bash history between sessions and reboots so you have access to them for a fair amount of time.
export HISTCONTROL=erasedups export HISTSIZE=10000 shopt -s histappend
The first one will remove duplicates from the history (when a new item is added). For example imagine the number of history spots taken up by ls. Not very useful.
The second one increase the history size. With duplicates erased, the history already holds a lot more actual information, but I still like to increase it from the default.
The third line ensures that when you exit a shell, the history from that session is appended to ~/.bash_history. Without this, you might very well lose the history of entire sessions (rather weird that this is not enabled by default).