|
|
|
|
|
by boffinAudio
1641 days ago
|
|
I do this too, but you know what is an even cooler and more rewarding way to exploit the shell history? By COMMENTING your commands: $ grep -i myname /etc/passwd # passgrep ..
.. $ Ctrl-R "passgr" It is so rewarding to do some intense bash work with liberal command line comments and then come back a few weeks later, "history | grep \#", and see my work notes - along with the relevant commands - available. I used to write '~/bin' scripts for special stuff, including comments in the .sh source itself - but now it just makes more sense to wang a comment at the end of the complex/interesting commands and then just grep for the comment later .. |
|
For commands that I reuse semi-frequently I set an environment variable so that I can easily find them with prefix searching. So for example I sometimes pin IPFS paths to Infura so I have this command in my history. I can then type pin=<Up> and recall that command (until it drops off the end of my shell history).