3 ms·
Setting a really large $HISTSIZE can accomplish some of this. Though I'll admit to occasional traumatic moments when my workstation crashes and bash history is
by dredmorbius 14y ago
Setting a really large $HISTSIZE can accomplish some of this.
Though I'll admit to occasional traumatic moments when my workstation crashes and bash history is polluted with multiple shells filling it and the stuff I've been ctrl-R invoking (recursive reverse search) for months evaporates.
- lgas 14y agoYou should set up a simple cron job to backup your history file (to somewhere else in your home directory) on some schedule (hourly?) and then when this happens just have an short alias that restores the last backup.
- dredmorbius 14y agoNo. The problem is curation. It's really handy to have stuff in history. But there's a ton of crap I don't need. What I need to do is get better about scripting the stuff that I'm invoking frequently. Though zsh probably has an extension that does this for you, and scratches your back. Mind: virtually all my shell scripts start off as one-liners that I've invoked and re-edited (M-x M-e FTFW) until I've realized I have something worth saving.
- ralph 14y agoSee if bash's ignoredups and erasedups helps.
- eru 14y ago> Setting a really large $HISTSIZE can accomplish some of this. Or making your history permanent. I have a reasonable sized history in my shell, but also dump out each line I typed to an eternal history file.