The "um" system
Page created: 2022-02-26 , updated: 2023-05-11One of the handiest note systems I have is a little shell script called "um" (I stole the name! See below.)
UPDATE: At some point, I turned the script into a Bash function, see below.
When I need a quick reminder of the command line syntax for find
or how to
write a loop in bash
, I can get quick answers - written by me! - in a flash
by just typing um find
or um bash
.
Because I write the content, it’s stuff I’m always looking up and (unlike the official man pages), it’s just what I need. Often just half a dozen lines.
Current um "pages" just to give you an idea:
-
awk
-
bash-prog
-
encryption
-
find
-
gpg
-
rsync
-
sed
-
sbopkg
-
ssh
-
tarsnap
-
usb
-
pass
-
spell
-
firefox
-
slackware
-
util
The contents of the um pages are stored in my wiki (under /um
) and a shell
script can list them, open them for editing, or display the closest match.
Three lines of glory (Bash function)
Here’s the entire definition of um
in my .bashrc
:
um () { cat ~/wiki/um/*$1* }
It could almost be an alias, but I’m not sure how I could do the wildcard match of the first parameter.
The original script had more features (like listing the current entries and opening $EDITOR to edit one), but I ended up not using them.
Might break out of wiki
Having the um pages in my wiki has a bunch of advantages: they’re consolidated, I won’t forget about them, it’s easy to list, create, and update pages.
The downside is that to use um, I’d have to grab a copy of my entire wiki. I’m thinking I might either put um’s contents in my bin repo, or break it out entirely into a new repo and just add an alias for it.
See also my Personal Linux Setup with Git Repos and Stow article about how I store personal repos and what-not.
Origins
This idea was sparked by a comment on Hacker News:
https://news.ycombinator.com/item?id=17797583 "I believe these two shell functions…can serve as a poor man’s um"
On a post:
https://news.ycombinator.com/item?id=17797355 Um - Create your own man pages so you can remember how to do stuff
About this cool project: