The Unix Way ■ Episode 11
In 1978, Doug McIlroy, head of the Bell Labs Computing Sciences Research Centre and inventor of the Unix pipe, wrote four sentences. They have outlasted every framework, every methodology, and every architectural manifesto published since. Rather impressive for a paragraph.
"Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new 'features'."
"Expect the output of every program to become the input to another, as yet unknown, program."
"Design and build software, even operating systems, to be tried early, ideally within weeks."
"Use tools in preference to unskilled help to lighten a programming task."
Eleven episodes into this series, and one does feel it is rather time to explain why it is called what it is called.
The Principles
Do one thing and do it well.
grep searches. sort sorts.
awk transforms. cut extracts. None
of them does the other's job. None of them needs to. Composition
replaces integration: small tools, connected by text streams,
solving problems their authors never anticipated. Rob Pike and
Brian Kernighan wrote in 1984: "The power of a system comes more
from the relationships among programs than from the programs
themselves." The pipe is not a feature. It is the architecture.
Text as the universal interface. Not JSON. Not
Protocol Buffers. Not YAML with its rather creative
interpretation of the word "NO" (which YAML helpfully coerces to
a boolean false, because of course it does). Plain
text, readable by humans and machines alike, piped from one
process to the next. Peter Salus summarised McIlroy's philosophy
in three lines: "Write programs that do one thing and do it well.
Write programs to work together. Write programs to handle text
streams, because that is a universal interface." A format that
has not required a version number in fifty years.
Silence is golden. A successful command returns
nothing. Only failure speaks. The exit code carries the meaning:
zero for success, non-zero for failure. In a world of verbose
logging frameworks, notification services, and dashboard metrics
for metrics, one does rather miss the quiet confidence of
$? = 0.
The filesystem as organisational principle.
Directories for structure, files for content, paths for
relationships, permissions for access control. No schema
registry. No configuration server. The hierarchy was always
there. chmod predates your IAM provider by four
decades. Last week's episode on
CSV made the case: the filesystem handles hierarchy so the
format does not need to.
Fail noisily. Eric Raymond's Rule of Repair: when you must fail, fail in a way that is easy to diagnose. A Unix tool that encounters an error writes to stderr and exits with a non-zero code. It does not return HTTP 200 with an error buried in a JSON body. It does not silently swallow exceptions. It fails, clearly, and lets the operator decide what to do. Quite the contrast to modern systems where "everything is fine" is the default response to catastrophe.
The Proof
FreeBSD embodies these principles in its
architecture more faithfully than perhaps any other operating
system in active development. The base system is one coherent
unit: kernel, userland, and documentation, all developed together
in a single source tree. Third-party software lives strictly in
/usr/local/, with its own
/usr/local/etc/ for configuration. The separation is
clean and inviolable. Each service is a small shell script in
rc.d,
using shared functions from rc.subr, inspectable
and composable. One package system: pkg. One ports
tree. One source of truth. FreeBSD's man pages, written in
mdoc(7) semantic markup, are widely regarded as
among the most comprehensive documentation in the industry.
Documentation is not an afterthought. It is a first-class
artefact.
macOS has been
certified UNIX by The Open Group
since October 2007. Every Mac ships with a POSIX-compliant
userland: sh, grep, awk,
sed, make, and the rest. macOS 26
Tahoe holds current certification for both Intel and Apple
Silicon. The tools are there. Most users never open Terminal.
One does wonder what they think the machine is for.
OpenBSD took "do one thing well" to its logical extreme: build the most secure general-purpose operating system ever built, because it refused to do anything else first. Two remote holes in the default install in nearly thirty years. That is not a feature list. That is a philosophy applied with discipline.
NetBSD applies the same principles to portability: one codebase running on over sixty hardware architectures, from mainframes to toasters. The code is clean enough to port because the abstractions are honest enough to adapt.
illumos, the open-source continuation of Sun's OpenSolaris, carries the SVR4 Unix heritage forward. ZFS, DTrace, and Zones were born here: filesystem integrity, dynamic tracing, and operating system virtualisation, each doing one thing, each doing it well.
The Departure
Linux is not UNIX. It is Unix-like. The Linux kernel itself is remarkably well-disciplined: Linus Torvalds' rule, "We don't break userspace," has held for decades. The kernel syscall interface is stable, predictable, and trustworthy.
But above the kernel, many distributions are quietly walking away from the principles that made Unix what it is.
systemd has absorbed init, logging (journald), DNS resolution (resolved), NTP (timesyncd), network configuration (networkd), device management (udevd), and an EFI boot manager into a single project. Its creator, Lennart Poettering, openly states: "systemd's sources do not contain a single line of code originating from original UNIX." He describes this as evolution. Others describe it differently.
Logging moved from plain text in /var/log/ to
binary journals. One cannot grep a binary file.
One cannot tail it. One cannot pipe it to
awk. The universal interface was replaced with a
proprietary query tool. Users
report 40x slower query performance
compared to grep on plain text. One does rather
find that instructive.
Package management fragmented: apt, snap, flatpak, pip, npm, all managing overlapping software on the same machine. Compare FreeBSD: one package system, one ports tree, one source of truth.
John Goerzen, a long-time Debian developer, put it plainly: "I used to be able to say Linux was clean, logical, well put-together, and organised. I cannot really say this anymore." The Devuan project forked Debian entirely to preserve "Init Freedom" without systemd entanglement. They described systemd as "an intrusive monolith." Rather un-Unix, that.
The Point
The most reliable systems in computing follow these principles. SQLite: one file, one job, backwards-compatible since 2004. CSV: one format, no opinion, no runtime. ZFS: one filesystem, complete integrity, snapshots and checksums built in. cron: one scheduler, fifty years, never broke. The pattern is not coincidence. It is philosophy, applied with patience.
Rob Pike's Rule 5: "Data dominates. If you have chosen the right data structures and organised things well, the algorithms will almost always be self-evident."
Dennis Ritchie said it best: "UNIX is basically a simple operating system, but you have to be a genius to understand the simplicity."
Eleven episodes in. This is why.
McIlroy (1978): "Make each program do one thing well." Pike (1984): "The power comes from the relationships among programs." Ritchie: "UNIX is simple, but you have to be a genius to understand the simplicity." FreeBSD, macOS, OpenBSD, NetBSD, illumos: the systems that follow the philosophy outlast the systems that ignore it. Every time.