4 ms·
I'm up to about 4 years of history at this point. I use a dumb bash hook that sorts and reloads the history on each command execution, and yes, it's getting a
by foobarian 7y ago
I'm up to about 4 years of history at this point. I use a dumb bash hook that sorts and reloads the history on each command execution, and yes, it's getting a little slow. I wish I could do this through some daemon-based DB-backed system but this works for now. Maybe I'll switch to zsh when it gets too slow.
The reason I have the hook reload and sort on each command is so that I can use a dozen screen sessions at once and:
1) they don't overwrite each other's history
2) each session's history is instantly searchable to the others
3) sorting is useful because each session prepends a session ID to the commands, so that Ctrl-R backward search can always hit the current session's commands first. And I can reboot/restart screen and recover history in each session.
(edit: I looked at the zsh-db project the other poster linked, and this does pretty much the same thing just probably slower since there is no DB involved).