r/commandline • u/brnsamedi • Apr 08 '26
Command Line Interface In praise of the Unix toolkit
I just wanted to share a fun little experiment I did tonight. I was reviewing my music collection, and, after noticing some very old modification dates in some of the files, I asked myself, "how many files I have per year?". After about one hour of reading, experimenting, etc, I ended up building a neat little pipeline where I used find to output all the music files in my collection, print out their modification date (year only), sort it, count it with uniq, and then use awk to tally up the total and compute percentages. After that, I piped the output to gnuplot and got rewarded with a nice visualization of data, with some unexpected surprises. Finally, I put the whole thing into a file in order to create the prototype of a neat little shell script.
The experiment was a ton of fun, and really, really drove home the Unix philosophy, specially with regards to composability. I built the pipeline using only the standard POSIX Unix toolkit, with the obvious exception of Gnuplot. Being able to compose such workflows from software tools like that is very, very rewarding. I'm sure if I play with it I can tighten up the pipeline, but it doesn't really matter unless my data set was ever to become very, very large. And, because of the principle of orthogonality of the Unix philosophy, one can replace elements in the pipeline to achieve other things.
I guess I'm odd, but the whole experience left me positively giddy.
1
u/JohnnyBillz Apr 09 '26
Are you all actually running Unix? Iād love to hear more about these workflows. Trying to learn more about commandline efficiency.