How can Bash history be automatically cleaned up? For example
- Remove detectable typos from history (
ls-lhdoes not show up in
which, so it is removed, I meant to type
- Clean excessive spaces
cd /should be normalized so they are the same.
Can this be done in bash? Maybe a filter on all commands before they are executed, or before they go into history?
I hope I don't have to wait until it is written to the file before running a cleanup routine. That would mean logging out before cleanup occurs.