We all know this. We need to do a specific task and with the help of the internet we find a specific tool alongside command line parameters to do the job right from the shell.
What is a good way of collecting/documenting these snippets on your own for future reference and use? Just a text file in the home folder?
Ctrl+R
I push them up to my self hosted gitlab server.
i use a joplin notebook. its like a private wiki, and it works on android too.
I just keep my history file around and have set it up to never truncate. Then
grep
or^R
.commands.txt every command with a one line description and a separator.
just alias them.
Just learn the basic POSIX commands (there’s probably 20-25) and understand pipes. Then you can do pretty much anything you’re likely to need from the command line. Sure, there will be more modern flashy friendly tools that come along. Some you’ll integrate into what you do. Some won’t have enough staying power to remember.
No notes. No googling or LLM. Just don’t skip to the end.
If you’re into self hosting, Bytestash is very nice!
I take notes in Joplin with the command and a breakdown of any flags, parameters, etc, and what they everything means/does.
i usually get to where i’m going using man pages rather than copying wholesale from the web, but when i find something worth saving i usually put the snippet in its own script in
~/.local/bin
, which is in myPATH
. with some modifications to make it generic, of course.I have a folder in my nextcloud, where I save scripts I find and/or use regularly.
spend more time in the shell. you will naturally learn the most commonly used commands and useful flags for them. soon you will be surprised by how much you know. having good typing speed helps reduce the friction a lot. i have not found need to specifically “memorize” anything consciously.
for obscure things, write a script and put it in a scripts folder, have a comment at the top explaining what it does for reference later.
deleted by creator
I just use Zsh’s command history, coupled with a bunch of functions and aliases to set up different HISTFILE values for different workflows.
I keep HISTFILEs clean by prepending a whitespace before commands that I don’t want to remember, which unfortunately gave me the habit of doing that on Bash when Zsh isn’t available (which is ineffective at best, and actively annoying at worst).
There is a command called
tldr
. it’s works similar to what you have described.