vim .bashrc
look for the following lines and adjust HISTCONTROL, HISTSIZE, and HISTFILESIZE accordingly:
#don't put duplicate lines or lines starting with space in the history.
#See bash(1) for more options
HISTCONTROL=ignoreboth:erasedups
#append to the history file, don't overwrite it
shopt -s histappend
#for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=9999
HISTFILESIZE=9999