The Unix philosophy

Unix was an operating system created at Bell Labs in the late 60s and early 70s. Before Unix, creator Ken Thompson worked on Multics — a system designed to do everything. The ultimate monolith. Thomson found it hard to learn and not fun to use. He hated it, and Bell Labs eventually abandoned it. Watch him talk about it in a recent oral history: https://youtu.be/OmVHkL0IWk4?si=nQAcSy6LE1VY5iiu&t=4687

The Unix philosophy was a response.1

In its most famous statement: "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."2

1. Small programs that do one thing well

2. Programs work together (composability)

3. Text streams as universal interface


Footnotes:

1 The Unix philosophy emerged in practice before it was formalized in linguistic maxims. An important early articulation came from Doug McIlroy, inventor of Unix pipes, in the Bell System Technical Journal in 1978 — nine years after Unix began. He wrote:

A number of maxims have gained currency among the builders and users of the UNIX system to explain and promote its characteristic style:

  1. Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new "features."
  2. Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.
  3. Design and build software, even operating systems, to be tried early, ideally within weeks. Don't hesitate to throw away the clumsy parts and rebuild them.
  4. Use tools in preference to unskilled help to lighten a programming task, even if you have to detour to build the tools and expect to throw some of them out after you've finished using them.

Illustrations of these maxims are legion:

  1. Surprising to outsiders is the fact that UNIX compilers produce no listings: printing can be done better and more flexibly by a separate program.
  2. Unexpected uses of files abound: programs may be compiled to be run and also typeset to be published in a book from the same text without human intervention; text intended for publication serves as grist for statistical studies of English to help in data compression or cryptography; mailing lists turn into maps. The prevalence of free-format text, even in "data" files, makes the text-processing utilities useful for many strictly data processing functions such as shuffling fields, counting, or collating.
  3. The UNIX system and the C language themselves evolved by deliberate steps from early working models that had at most a few man-months invested in them. Both have been fully recoded several times by the same people who designed them, with as much mechanical aid as possible.
  4. The use of tools instead of labor is nicely illustrated by typesetting. When a paper needs a new layout for some reason, the typographic conventions for paragraphs, subheadings, etc. are entered in one place, then the paper is run off in the new shape without retyping a single word.

2 Peter H. Salus, A Quarter-Century of Unix (1994).

2025-11-06

Home