Bash is losing history even though shopt -s histappend is set
I lost all commands that were executed from the last session - they do not show up in history at all. What needs to be done to prevent this??
I had added
shopt -s histappendjust for this purpose .. but it is either not taking at all or at the very least not reliably.
~/spark >shopt | grep histappend
histappend on 2 Answers
Following combination seems to be working:
unset HISTFILESIZE
HISTSIZE=10000
PROMPT_COMMAND="history -a"
export HISTSIZE PROMPT_COMMAND
shopt -s histappend Check permissions in the .bash_history file (and its parent)
Sometimes this is deliberately changed to prevent history from being used (and potentially capturing things like passwords in the command line)