diff --git a/.bashrc b/.bashrc
index 4815e4d..b88aa26 100644
--- a/.bashrc
+++ b/.bashrc
@@ -2,6 +2,12 @@
 # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
 # for examples
 
+# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
+HISTSIZE=5000
+HISTFILESIZE=10000
+shopt -s histappend
+export PROMPT_COMMAND="history -a; history -c; history -r; $PROMPT_COMMAND"
+
 # If not running interactively, don't do anything
 case $- in
     *i*) ;;
@@ -75,3 +81,4 @@ fi
 if [ -f ~/git/dotfiles/.colors ] ; then
         . ~/git/dotfiles/.colors
 fi
+