How to save Bash History from multiple terminals

Valic —  December 7, 2012 — Leave a comment

It is often the case that you have multiple terminals open on one system. With bash with default settings once you press the up button you can’t see the previous command entered on other terminal but you can see the commands entered on the same terminal. This problem is getting even worst. On default, bash history is  saved only for the last closed session.

Now if you want to save all bash history for all open sessions do the followings: Open the .bashrc file from your home directory and add the lines:

shopt -s histappend export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"



Posts Twitter Facebook

Editor in Chief at Debian-Tutorials, Linux enthusiast.

No Comments

Be the first to start the conversation.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.