
Ask HN: Looking for a series on implementing classic Unix tools from scratch - totalperspectiv
This can be blogs, books, or YouTube. I&#x27;m working on upping my C skills and have started to reimplement some tools like wc, cat, etc. I&#x27;m wondering if there are good walkthroughs out there for some of the more complex tools like sort, xargs, etc.<p>Any further advice on C for the 20 teens is also welcome.
======
vram22
I have been casually writing Python versions of such Unix tools (not with all
the features and options, just the parts that I feel like or know how to do)
off and on, for a while now, and often post about them on my blog, when I do
write such tools. The union of the sets of posts at these two links:

[http://jugad2.blogspot.in/search/label/command-
line](http://jugad2.blogspot.in/search/label/command-line)

and

[http://jugad2.blogspot.in/search/label/python](http://jugad2.blogspot.in/search/label/python)

should have many such posts about versions of Unix command line tools
implemented by me in Python.

Also, this tutorial I wrote years ago for IBM developerWorks may be of use, to
learn some of the informally handed down but generally accepted principles and
techniques for writing such command line tools in C:

Developing a Linux command-line utility:

[https://jugad2.blogspot.com/2014/09/my-ibm-developerworks-
ar...](https://jugad2.blogspot.com/2014/09/my-ibm-developerworks-article.html)

The post is an overview of the article I wrote for IBM, with some background
about it, etc. For the actual code in C and the PDF of the IBM article, follow
relevant links in the post, to more than one level, as needed.

~~~
totalperspectiv
Your posts are excellent! Thank you for sharing them!

~~~
vram22
Thank you! You're welcome.

------
aargh_aargh
Read the source, but rather than the GNU variants, look at the *BSD ones.
They're much more readable.

------
totalperspectiv
For future travelers, these are the best resources I've seen so far:
[https://learnto.computer](https://learnto.computer)
[https://viewsourcecode.org/snaptoken/kilo/](https://viewsourcecode.org/snaptoken/kilo/)
[https://www.cs.princeton.edu/courses/archive/spr09/cos333/be...](https://www.cs.princeton.edu/courses/archive/spr09/cos333/beautiful.html)

------
koots
Hacker Tools MIT course Learn to make the most of the tools that hackers have
been using for decades. [https://hacker-tools.github.io](https://hacker-
tools.github.io)

------
msie
“Software Tools” by Kernighan & Plauger

~~~
vram22
I've heard that book recommended a lot earlier, in various other good books or
articles. Would like to read it. But not the original one in RATFOR, rather
the second version in Pascal. Just checked on Amazon, there is a copy, but not
in Pascal.

Update: Just found a used copy of the Pascal version on Amazon India, ordered
it.

------
monadgonad
> Any further advice on C for the 20 teens is also welcome.

The book 21st Century C by Ben Clemens is worth a look.

