实时保存你的命令到bash history文件中

shopt -s histappend ; PROMPTCOMMAND="history -a;$PROMPTCOMMAND"