tech.linux.bash.configuration.eternal.history
Created Monday 29 September 2025
My favorite bash configuration is to make the history unlimited. This lets you recall commands with ctrl+r from any point in the past so you can do complicated one-liners and never have to type anything twice.
At work, I have a .bashrc_eternal_history dating back to Aug 15, 2024 (It's Sept 2025 now) and the file is 1.9MB and it's great. I usually just create a new one when I change computers at work and don't combine them as each computer tends to be different.
# Eternal bash history. # --------------------- # Undocumented feature which sets the size to "unlimited". # http://stackoverflow.com/questions/9457233/unlimited-bash-history export HISTFILESIZE= export HISTSIZE= export HISTTIMEFORMAT="[%F %T] " # Change the file location because certain bash sessions truncate .bash_history file upon close. # http://superuser.com/questions/575479/bash-history-truncated-to-500-lines-on-each-login export HISTFILE=~/.bash_eternal_history # Force prompt to write history after every command. # http://superuser.com/questions/20900/bash-history-loss PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
References
1 https://stackoverflow.com/questions/9457233/unlimited-bash-history
Backlinks: Home