Gratitude Day 19: UNIX Shell
Sat 19 September 2026
Disclaimer: This post was indirectly inspired by a similar (and very enjoyable) post by the amazing Stefano, but it was germinating in my brain long before I realized the thematic similarities.
I've been programming in UNIX shell (mainly ksh, then bash, and now a bit more POSIX shell) for about a quarter century, now. It's really my favorite environment.
First, let's get some common objections out the way.
No serious programmer writes in shell! They use Python, I mean C, I mean assembly, I mean a magnetized needle and a steady hand, I mean
C-x M-c M-butterfly
Yeah, you're probably right. Next?
Who needs bash/POSIX shell? My shell has pretty colors, a 3D interactive prompt and status line, full git integration, an app store, and takes full advantage of my GPU-accelerated terminal that runs on my 1024-core gaming computer with its own micro-fusion reactor!
I'm happy for you. Genuinely. 😄
I've been using Unix-based OSes (first various Linux distros, then OpenBSD, FreeBSD, and now NetBSD as well) as my full-time daily-drivers for seven years now. In that time, I've slowly grown a decently sizeable collection of scripts and functions that make daily life way more enjoyable:
rld@Intrepid:~$ echo; \
> echo " lines words bytes"; \
> find bin bin/scripts -maxdepth 1 -type f -exec wc {} + \
> |grep total \
> |sed 's|total|(~/bin total)|'; \
> echo "----------------------------------------"; \
> wc .bash_[af]*
lines words bytes
20870 286632 2146265 (~/bin total)
----------------------------------------
414 2140 18387 .bash_aliases
2074 7907 59284 .bash_functions
2488 10047 77671 total
rld@Intrepid:~$ #functions:
rld@Intrepid:~$ declare -F |grep -c '^declare -f [^_]'
150
rld@Intrepid:~$ #aliases:
rld@Intrepid:~$ alias |wc -l
135
rld@Intrepid:~$
Theres some things that I really, really love about this environment.
First of all, shell scripts and shell functions can build on each other. It's the "write several small tools that do one thing well and can work together" aspect of The Unix Philosophy in motion, and it makes for a really enjoyable experience of slowly building a decent-sized toolchest of utilities organically.
Now, of course, I don't use all of those scripts every day. I don't use most of them hardly at all:
rld@Intrepid:~$ echo; \
> echo "count epoch-rounded gregorian-date"; \
> find bin bin/scripts -maxdepth 1 -type f -exec stat -f %a {} + \
> |sort -n |sed -E 's/[0-9]{6}$/000000/' |uniq -c \
> |while read line
> do
> count=${line%% *}
> epoch=${line##* }
> printf "%4d %12d " $count $epoch
> date -r $epoch
> done
count epoch-rounded gregorian-date
145 1763000000 Wed Nov 12 20:13:20 CST 2025
9 1764000000 Mon Nov 24 10:00:00 CST 2025
2 1765000000 Fri Dec 5 23:46:40 CST 2025
3 1766000000 Wed Dec 17 13:33:20 CST 2025
1 1767000000 Mon Dec 29 03:20:00 CST 2025
1 1768000000 Fri Jan 9 17:06:40 CST 2026
1 1769000000 Wed Jan 21 06:53:20 CST 2026
2 1770000000 Sun Feb 1 20:40:00 CST 2026
1 1773000000 Sun Mar 8 15:00:00 CDT 2026
1 1774000000 Fri Mar 20 04:46:40 CDT 2026
2 1776000000 Sun Apr 12 08:20:00 CDT 2026
4 1777000000 Thu Apr 23 22:06:40 CDT 2026
4 1778000000 Tue May 5 11:53:20 CDT 2026
3 1779000000 Sun May 17 01:40:00 CDT 2026
11 1780000000 Thu May 28 15:26:40 CDT 2026
1 1781000000 Tue Jun 9 05:13:20 CDT 2026
2 1782000000 Sat Jun 20 19:00:00 CDT 2026
2 1784000000 Mon Jul 13 22:33:20 CDT 2026
1 1785000000 Sat Jul 25 12:20:00 CDT 2026
6 1787000000 Mon Aug 17 15:53:20 CDT 2026
16 1788000000 Sat Aug 29 05:40:00 CDT 2026
3 1789000000 Wed Sep 9 19:26:40 CDT 2026
rld@Intrepid:~$
rld@Intrepid:~$ find bin bin/scripts -maxdepth 1 -type f |wc -l
221
rld@Intrepid:~$
In the above code snippet, I've taken the atime (last access time) of every file in my ~/bin directory, rounded it (well, truncated) to the nearest million seconds (11 days, 13:46:40), printed how many files were accessed within that million second window, and printed the Gregorian date equivalent of that epoch date.
According to the above, I set up this laptop some time last November (accurate), and I've only used 25 of my 211 scripts in the last month or so.
Oh wait... I've just realized that atime on this system is not reliable. I should have known, derp:
rld@Intrepid:~$ mount |grep noatime
zroot/ROOT/14.3-RELEASE-p6_2025-12-05_225632 on / (zfs, local, noatime, nfsv4acls)
zroot/var/audit on /var/audit (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/usr/src on /usr/src (zfs, local, noatime, nfsv4acls)
zroot on /zroot (zfs, local, noatime, nfsv4acls)
zroot/var/crash on /var/crash (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/usr/ports on /usr/ports (zfs, local, noatime, nosuid, nfsv4acls)
zroot/var/log on /var/log (zfs, local, noatime, noexec, nosuid, nfsv4acls)
zroot/var/tmp on /var/tmp (zfs, local, noatime, nosuid, nfsv4acls)
zroot/home on /home (zfs, local, noatime, nfsv4acls)
zroot/home/rxl on /home/rxl (zfs, local, noatime, nfsv4acls)
So instead, I went through my command history on this machine for the past month, and analyzed what commands/scripts/aliases I used:
1 cal2 is an alias
1 cdclip is an alias
1 clipclear is /home/rld/bin/clipclear
1 cppwd is an alias
1 de_banner is /home/rld/bin/de_banner
1 dectohex is /home/rld/bin/dectohex
1 fedimeteo is an alias
1 figletfonts is an alias
1 freebsdfree is /home/rld/bin/freebsdfree
1 help is an alias
1 mcd is a function
1 notice is /home/rld/bin/notice
1 ramhogs is a function
1 snarfclear is /home/rld/bin/snarfclear
1 snarfi is /home/rld/bin/snarfi
1 stls is a function
1 strip-jpeg-MP is /home/rld/bin/strip-jpeg-MP
1 swc is a function
1 temps is /home/rld/bin/temps
1 tootuser is /home/rld/bin/tootuser
1 ulocate is /home/rld/bin/ulocate
1 uptime is an alias
1 weather is an alias
1 webview is a function
1 zipinfo is an alias
2 /home/rld/Documents/writings/blog/pelican/content/count2
2 binfind is a function
2 clear2 is an alias
2 clipi is /home/rld/bin/clipi
2 edvis is a function
2 ifsn is a function
2 showclip is /home/rld/bin/showclip
2 visway is an alias
3 /home/rld/battery_ctrl.sh
3 bookmarks is an alias
3 dwroulette is /home/rld/bin/dwroulette
3 edir is an alias
3 emoji-picker is /home/rld/bin/emoji-picker
3 giturl is a function
3 pwdl is a function
3 searchall is /home/rld/bin/searchall
4 tootlookup is a function
4 yt-dlp is an alias
5 battime is an alias
5 blogwordcount is /home/rld/bin/blogwordcount
5 datestamp is /home/rld/bin/datestamp
5 duh is /home/rld/bin/duh
5 ffprobe is an alias
5 sdiff is an alias
5 updateall is /home/rld/bin/updateall
5 yt-mpv is /home/rld/bin/yt-mpv
6 grepc is a function
6 invid is a function
6 snarftoclip is /home/rld/bin/snarftoclip
6 toot is an alias
7 /home/rld/Documents/writings/blog/pelican/content/count
7 /home/rld/Documents/writings/blog/pelican/content/mksymlink
7 cp is an alias
7 df is an alias
7 mpv is an alias
7 open is an alias
7 tootme is /home/rld/bin/tootme
8 battestimate is a function
8 blogme is /home/rld/bin/blogme
8 daylog is /home/rld/bin/daylog
8 free is an alias
8 lsgrep is a function
9 fcal is /home/rld/bin/fcal
9 histbackup is /home/rld/bin/histbackup
9 mv is an alias
9 pkgbins is /home/rld/bin/pkgbins
9 unixnotes is a function
10 psgrep is /home/rld/bin/psgrep
11 s is an alias
12 ststatus is an alias
14 snarfedit is hashed (/home/rld/bin/snarfedit)
15 nsxiv is an alias
16 dict is an alias
16 rld is an alias
16 wifiscan is a function
19 biblegrep is a function
23 /home/rld/Documents/writings/blog/pelican/blogcal
26 clipo is /home/rld/bin/clipo
28 snarfo is hashed (/home/rld/bin/snarfo)
64 ll is an alias
71 duck is /home/rld/bin/duck
86 grep is an alias
223 ls is an alias
Sorry if this schlocky, sleep-deprived technomissive isn't quite comprehensible today. I'm gonna call it a blost. CHEERS! 😂
Back to index
Category: Tech
Tags:
BSD
Computing
FOSS (Free and Open Source Software)
FreeBSD
Hobbies
Linux
Monthly themes
Non-religious post
Productivity
UNIX
Unix Tips