4 ms·
Save all bash history into a separate file. Even with a high limit, the default bash history functionality has bugs that will destroy your history now and then
by bluquark 6y ago
Save all bash history into a separate file. Even with a high limit, the default bash history functionality has bugs that will destroy your history now and then. With the following .bashrc settings I have commandline history going back a decade:
export HISTTIMEFORMAT='%F-%T'
PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND ; }"'echo \
bash$SHELLNO $PWD "$(history 1)" >> ~/.bash_eternal_history'
- pxtail 6y agoAs addition to this advice one can use history autocomplete tool like for example this one: https://github.com/dvorka/hstr https://github.com/dvorka/hstr - very useful!