I suddenly got a problem with my bash history. When I type history
, it only shows:
1 history
I tried following commands:
set -o | grep history
echo $HISTFILE
echo $HISTSIZE
echo $HISTFILESIZE
and I got, respectively, the following results:
history on
/home/mary/.bash_history
1000
2000
I added also to my bashrc, the following lines:
# Avoid duplicates
HISTCONTROL=ignoredups:erasedups
# When the shell exits, append to the history file instead of overwriting it
shopt -s histappend
# After each command, append to the history file and reread it
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r"
Everything seems OK but I can't scroll back to retrieve commands and the reason seems the fact that nothing has saved in history and that is why the command history does not contain anything.
Could you please help me to solve this issue ?
/home/mary/.bash_history
? It should contain the information you're looking for .../home/mary/.bash_history
- is it owned by you? This can be seen with the commandls -la
.