Bash history too valuable to lose
I've started version controlling my .bash_history, since it feels like my extra memory. Being able to Ctrl-r
search everything just lets me remember how to do a whole lot more things without explicitly writing them down and later looking them up. This also allows me to crudely synchronise between development machines every week or so.
McClane, Charles Stanhope, clacke@libranet.de ❌, Tyng-Ruey Chuang and 1 others likes this.
I have largely replaced aliases or functions in ~/.bash_aliases (called from ~/.bashrc) with just named functions in .bash_history. Version control becomes natural and immediate.
So I just:
$ useful_function() { for blah in blahs; do stuff; done; }; useful_function
And then calling is just C-r useful_fun, and if I need to change something I change it, and then enter and boom, new version.
So I just:
$ useful_function() { for blah in blahs; do stuff; done; }; useful_function
And then calling is just C-r useful_fun, and if I need to change something I change it, and then enter and boom, new version.
@Claes Wallin (韋嘉誠) What happens when you restart the system or log out though, do you just Ctrl-r back to the definition?