If you open Multiple sections of Linux terminal, only one copy of history will
be saved in your .bash_history file. This would be really annoying because you
will forget and loose important command that you have used.
Here is how to save all your histories.
Put the following commands in your ~/.bashrc file or your ~/.bash_profile file.
Sometimes you want to ignore some test commands or commands includes passwords
in your history records. Here is how to do that:
You may also want to ignore duplicated entries
To ignore both of them, you can do either ignorespace:ignoreredups or
ignoreboth.
The complete list of commands to be added in ~/.bashrc is: