Tuesday, June 17, 2008

How to make history appendable across multiple concurrent bash shells

I've been meaning to change the default bash setting in Debian/Ubuntu for saving the command history across multiple concurrent shells.

Thought I'd document what I ended up doing.

I added the following to the end of my ~/.bashrc

# my settings
shopt -s histappend
shopt -s histverify
set -b

I got a litle carried away and added a couple of extra tweaks to suit my preferences. histverify lets you edit commands recalled from history expansion before executing them. set -b makes background process notification happen in real time rather than waiting for the next shell prompt.

Enjoy!

No comments: