For comparison, my (non-work) history since 2012 (plain text) is 181k entries, and takes 25MB. I store the command along with when and where you ran it. (https://www.jefftk.com/p/logging-shell-history-in-zsh)
I'm probably being wasteful of space because I store each session in a separate file. I used to do a lot of data analysis at the shell back in the day, and found it useful to audit sequences of commands afterwards for mistakes, or to turn them into scripts.
Do you rebase your git repos regularly to delete commits older than 6 months?
Didn't they already? eg stemming
"We could learn advanced regexes... or we could just use FTS5".
Hard call. :)
Additionally, everything you describe can be phrased as a regular expression.
If there's something I do repeatedly, I make an alias or a function for it.
I guess you could set up an entropy scanner and flag history lines that have high entropy, but that might not be enough (low-entropy secrets) and might be bothersome (lots of false positives / things that are technically secrets but that you don't care if they're in your shell history).
I would highly recommend anyone who spend a lot of time in terminal to improve their shell history by using atuin or similar tools, cannot tell how many times it actually helped me to find some important information there, about how I did one thing or another.
-
- [1] https://www.outcoldman.com/en/archive/2017/07/19/dbhist/
- [2] https://loshadki.app/shellhistory/