3 ms·
I keep my shell history in sqlite database since 2017. Around 120k records at this point. Never synced history from the work laptops. Only personal history. In
by outcoldman 3y ago
I keep my shell history in sqlite database since 2017. Around 120k records at this point. Never synced history from the work laptops. Only personal history.
In 2017 wrote my own bash script (later optimized for zsh) to just record everything in sqlite with hooks on prompt. [1]
I mostly work right now on Mac, don't need to support Linux anymore, so wrote an app for Mac, that syncs the history over iCloud, and has a GUI interface. [2]
Anyway, storing years of shell history somewhere, where you can do complex searches, and actually find some magic command you run a few years ago, is priceless.
- [1] https://www.outcoldman.com/en/archive/2017/07/19/dbhist/ https://www.outcoldman.com/en/archive/2017/07/19/dbhist/
- [2] https://loshadki.app/shellhistory/ https://loshadki.app/shellhistory/
- thekashifmalik 3y agoDo you know any way to accomplish the same thing but keeping the history in plaintext? Would love to still be able to run SQL over it.
- hakcermani 3y ago.. i replied to the main thread, if you want give my bash script a try. each project history is in its own named file .. https://gist.github.com/appsmatics/ff27e885460bd345eabe1c5f70c4438b https://gist.github.com/appsmatics/ff27e885460bd345eabe1c5f7...
- bdcravens 3y agoCouldn't you just point DuckDB or a similar tool to the history file?
- hughesjj 3y agoWrite to two places in the hook?