Detailed post: https://kghose.github.io/linux/bash-history.html
If you like to keep multiple terminals open for different purposes and you wanted a way to keep the command history for each of them, and keep them separate:
Here is the relevant part of my ~/.bashrc
# Create a directory for...