4 ms·
I use this in my bash profile: export HISTSIZE=65535 shopt -s histappend PROMPT_COMMAND="history -a;$PROMPT_COMMAND" I miss it though on other computers
by hawski 3y ago
I use this in my bash profile:
export HISTSIZE=65535
shopt -s histappend
PROMPT_COMMAND="history -a;$PROMPT_COMMAND"
I miss it though on other computers and suffer until I set it up on new ones.
- tambourine_man 3y ago> 65535 Why limit yourself to 16bit?
- hawski 3y agoJust a big enough number and I punish myself as I would like to create my own shell/terminal thing and use that instead.
- tambourine_man 3y agoI hope you get to it eventually, but if you do, consider 32 bits instead. Computers are fast, memory is cheap and 16 bits is not that big. My .bash_history is clocking at 55814 now with dedup on. Granted, it's beeing going for years, but still, no reason to punish yourself.
- samstave 3y ago>>>55814 now with dedup on. Granted, it's beeing going for years As you can see, Mr. Anderson, we've been keeping our eye on you for some time now
- tambourine_man 3y agoI wish
- jefftk 3y agoImportant! My history file on my laptop is up to 200,342.
- tambourine_man 3y agoWith dedup on? That’s some serious typing.
- jefftk 3y agoDedup off, since I use my history to reconstruct things I've done and for that I want the full sequence of commands. Checking now it's 104,545 unique commands. It goes back to April 2012. Note that this is just my laptop; things I've run on my work computer or when ssh'd somewhere else aren't included.
- jmholla 3y agoThe last time I attempted this, it caused going back through the history in a separate shell to show entries from all other existing shells in order. Since I use each shell as separate workspaces, the clashing was unbearable. Now, I do: # Undocumented feature which sets the size to "unlimited". # http://stackoverflow.com/questions/9457233/unlimited-bash-history export HISTFILESIZE= export HISTSIZE= and just depend on exiting my shells to store data long term.
- oxygen_crisis 3y agoIf you're using bash 4.3 (released 2014) or higher you could convert this from using an "undocumented feature" to use the documented feature that does the same... > "Numeric values less than zero result in every command being saved on the history list (there is no limit)." export HISTFILESIZE=-1 export HISTSIZE=-1