The Unix Philosophy - Explained and Extended

Last updated — Oct 29, 2024
First published — Oct 29, 2024
#unix #bsd #gnu #linux #history

Unix philosophy. Software tools. Simple is beautiful. DOTADIW, KISS. Minimal, simple, clear. Modular, reusable, testable, quick. Free, unrestricted, customizable.

Article Collection

This article is part of the following series:

1. Unix

Table of Contents

Introduction

As mentioned in the History of Unix, BSD, GNU, and Linux, Unix was created in the early 1970s by AT&T Bell Labs’ employees Ken Thompson and Dennis Ritchie, with support from Brian Kernighan, Joe Ossanna, Robert Morris, the department head Doug McIlroy, and few others.

Prior to inventing Unix, its authors were familiar with the earlier operating systems Compatible Time-Sharing System (CTSS), Berkeley Timesharing System, Multics, Incompatible Timesharing System (ITS), and TENEX, all of which contributed novel ideas to the field of operating systems.

The authors’ past experience, skill, and insight were channeled into Unix. From the beginning Unix was intended to be a complete system – it included the kernel and utilities needed to make the system useful. There were also programs that made the system self-contained and able to support its own development – text editors, compilers, debuggers, documentation tools, etc.

Through work on Unix it became clear that the authors had exceptional talent for straightforward expression of complex ideas. Their approach was simple, powerful, and general. Many aspects of the implementation became mere consequences of the underlying design.

As the design had its own merit unrelated to a particular implementation, it was gradually documented and named the Unix philosophy.

This article explains the Unix philosophy in more detail, gives additional examples and clarifications, and expands its usual description with additional high-level insights.

Unix Philosophy

The Unix philosophy was explained by its authors and notable users using roughly the following sentences:

  • Make it easy to write, test, and run programs.

  • Avoid complex interfaces. Simple is beautiful.

  • Make each program Do One Thing And Do It Well (DOTADIW). Keep it Simple, Stupid (KISS).

  • Prefer economy and elegance of design due to size constraints (“salvation through suffering”).

  • Text is a universal interface. Write programs that handle text streams. Store data in flat text files.

  • Don’t insist on interactive input. Don’t require long or unnecessary input.

  • Don’t output unnecessary information. Avoid columnar or binary output.

  • Expect the output of every program to become input to another, unknown program. The power of a system comes more from the relationships among programs than from the programs themselves.

  • Build a prototype as soon as possible. Design and build software, even operating systems, to be testable quickly, ideally within weeks. Don’t hesitate to throw away and rebuild clumsy parts.

  • Choose portability and developer time over efficiency and machine time.

  • Write support tools to help with particular tasks. It doesn’t matter that they are not the main program.

Summary

Summarizing the Wikipedia page on Unix philosophy further, it seems the following individual words describe it best:

  • Minimal, simple, compact, clear, readable, beautiful, lean

  • Separate, modular, extensible, composable

  • Reusable, repurposable

  • Quick, dynamic

  • Text-based

However, these descriptions are not all there is to it. We could consider them to belong to a middle level of description. From there we could move up towards an even broader, high-level description, and down, towards more operational, practical concepts and implementation.

General Characteristics

At a high level, we can conclude that Unix and/or its most popular branches, BSD and GNU/Linux, run on everything and everywhere – on all top 500 supercomputers (GNU/Linux), all Intel CPUs after 2015 (MINIX), all mobile phones and tablets (Android and iOS), all architectures (PC, POWER, ARM, RISC-V…), and basically everything else related to high-tech research and development. GNU/Linux even runs on 4.5% of all desktops.

There are a couple overarching and somewhat overlapping properties of Unix that made it possible:

  1. Unix proved to stand the test of time. Most of Unix commands that existed in 1970s are still in use today. Learning and practice is not wasted nor influenced by commercial companies’ interests.

  2. Unix always had an elusive and interesting characteristic of catering especially good to the extremes of the user spectrum – the quick and cheap group on one hand, and the professional, cutting-edge group on the other. This characteristic was best described by a saying “Unix makes simple things simple, hard things possible”.

  3. Because Unix was designed by people of exceptional skill, and because it was designed to be modular, it resulted in a system that was not limited by its authors’ foresight. This was best described by a saying “In Unix a program becomes successful when it gets used for a purpose or in combination which the original authors did not anticipate”.

  4. Because of everything mentioned, the authors of Unix have struck an optimal balance between users and developers. Development (or in any other sense more advanced) tools are available at the same level of simplicity on which other, basic system commands and features are available. This is an environment in which it naturally and effortlessly happens that users progress in knowledge and skill over time.

  5. Thanks to their free and open source licenses, BSD and GNU/Linux systems have guaranteed everyone the right to use, study, modify, and share the modified software. The free, unrestricted access to source code and usually its zero cost have removed all artificial barriers to both entry and achievement, that all other companies have embedded into their products.

  6. Because of everything mentioned, Unix systems were able to grow and expand as users needed them without hitting definite limitations. Or, if limitations were present in general, Unix systems were the best tool to try overcome them.

Individual Concepts

(WIP) This section describes or links to individual concepts that either contribute significantly to the practical understanding of the Unix philosophy, or are its most observable consequences.

Kernel, C Library, and Shell

The Command Line

Runcomm, parsing command line options.

Text as a Universal Interface

Everything is a File

Streams and Redirection

Arbitrary Formats

No limits on format/size/name/content (program decides).

Article Collection

This article is part of the following series:

1. Unix

Automatic Links

The following links appear in the article:

1. History of Unix, BSD, GNU, and Linux - /unix-history/
2. AT&T Bell Labs - https://en.wikipedia.org/wiki/Bell_Labs
3. Berkeley Timesharing System - https://en.wikipedia.org/wiki/Berkeley_Timesharing_System
4. Brian Kernighan - https://en.wikipedia.org/wiki/Brian_Kernighan
5. Compatible Time-Sharing System (CTSS) - https://en.wikipedia.org/wiki/Compatible_Time-Sharing_System
6. Dennis Ritchie - https://en.wikipedia.org/wiki/Dennis_Ritchie
7. Doug McIlroy - https://en.wikipedia.org/wiki/Doug_McIlroy
8. Incompatible Timesharing System (ITS) - https://en.wikipedia.org/wiki/Incompatible_Timesharing_System
9. Joe Ossanna - https://en.wikipedia.org/wiki/Joe_Ossanna
10. Ken Thompson - https://en.wikipedia.org/wiki/Ken_Thompson
11. Kernel - https://en.wikipedia.org/wiki/Kernel_(operating_system)
12. Multics - https://en.wikipedia.org/wiki/Multics
13. Robert Morris - https://en.wikipedia.org/wiki/Robert_Morris_(cryptographer)
14. TENEX - https://en.wikipedia.org/wiki/TENEX_(operating_system)
15. Top 500 Supercomputers - https://en.wikipedia.org/wiki/TOP500
16. Unix Philosophy - https://en.wikipedia.org/wiki/Unix_Philosophy
17. 4.5% of All Desktops - https://www.tomshardware.com/software/linux/linux-market-share-approaching-45-for-first-time-could-hit-5-by-1q25