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?
There is a command called
tldr
. it’s works similar to what you have described.If you like TUI you might find this useful:
Thanks, this looks like the tool I was looking for. Being able to store the snippets alongside a description sounds perfect
I do mine in Obsidian, I just have a folder for ‘computer notes’ and whenever I figure out a new thing I drop it in there.
Some stuff I use often I set up as an alias too. So for example I have
alias yt='yt-dlp -f "bestvideo[ext=mp4]+bestaudio[ext=m4a]/mp4"'
for my most commonly used yt-dlp settings, so now I can just doyt [URL of video]
to quickly download something from YouTube. Oralias rs="sudo rsync --ignore-existing -rav"
for my rsync settings for a specific backup folder I copy a lot.In my obsidian i use the daily note feature heavily and if i come across a useful snippet or info i will add a tag and content like below. I found tagging to be helpful because i do not have to spend effort up front putting the file in the “right” folder. I have cleaned some of these up by removing them from my daily notes and into dedicated notes, but only after i have collected quite a few for a specific language or tech and there is a need for me to put more structure around the information.
#codesnippet/<language or tech stack> Write a description to help me remember what this is for
<insert code here>
Ctrl+R
If you’re into self hosting, Bytestash is very nice!
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.
I push them up to my self hosted gitlab server.
I’d try a wiki of some sorts. Personally we collect a lot of stuff in our bookstack instance. Recently we’re looking into tools that can save a page for offline usage.
I take notes in Joplin with the command and a breakdown of any flags, parameters, etc, and what they everything means/does.
I use a text file and have an alias to access it quickly.
just alias them.
commands.txt every command with a one line description and a separator.
I just keep my history file around and have set it up to never truncate. Then
grep
or^R
.i use a joplin notebook. its like a private wiki, and it works on android too.
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.