Lines from the PDP-7: The Fifty-Year Journey of Unix Cat

A central glowing glass pyramid built from sapphire blue and amber blocks, with smooth metallic spheres on its steps against a dark navy gradient.

In 1969, Ken Thompson sat down at a Digital Equipment Corporation PDP-7 computer to write the original version of the Unix utility cat. Because the C programming language did not yet exist, Thompson authored the utility in PDP-7 assembly using a custom assembler he built himself. His assembler extended standard instructions by allowing semicolons to separate multiple statements on a single line and introducing temporary numeric labels 0 through 9 to streamline local jumps. According to historical source code documentation, this initial 1969 assembly implementation already included early buffered versions of the getc and putc routines for handling input and output operations.

Assembly Foundations on the PDP-7

The custom assembler extensions Thompson designed for the PDP-7 allowed early Unix programs to remain compact while managing low-level hardware routines. The temporary labels 0 through 9 reduced symbol table overhead in the assembler, letting Thompson reuse numeric jump targets throughout the file without inventing unique names for every small branch.

PDP-11 Refinement and the Transition to C

When Unix was ported to the Digital Equipment Corporation PDP-11, cat was rewritten for the new system's instruction set. The PDP-11 version refined the utility's behavior so that if invoked without file arguments or with a single dash, it read directly from standard input. A major structural shift arrived with the Seventh Edition of Unix, which introduced the first implementation of cat written in the C programming language. Centered on a classic two-line reading loop that processed characters until reaching an end-of-file signal, this Seventh Edition release recognized only one command-line option: a -u flag that turned off default 512-byte block buffering.

The 4BSD Options and Kevin Fall's Net/2 Rewrite

As Unix software evolved across academic environments, the fourth Berkeley Software Distribution release—known as 4BSD—expanded the utility's command-line interface in 1980. This version introduced flags including -n, -b, -v, -s, -e, and -t to control line numbering and character display. In 1989, computer scientist Kevin Fall undertook a complete reimplementation of cat for BSD Net/2, a project designed to eliminate proprietary AT&T Unix source code from the distribution. Fall reorganized the tool by separating its execution into a raw mode for standard character copying and a cooked mode for managing command-line formatting options.

Modern Operating Systems and Code Durability

Fall's architectural rewrite proved remarkably durable across decades of operating system releases. Apple imported a 2005 FreeBSD implementation of cat—which maintained Fall's core structure—into Mac OS X 10.5 Leopard in 2007. Although surrounding software libraries evolved, the underlying structure of Fall's 1989 codebase remained intact inside the system's command-line tools. Today, inspecting the source code for cat on a modern macOS installation shows Kevin Fall's name preserved at the very top of the file header.

The continued operation of Fall's 1989 code structure on millions of contemporary laptops demonstrates how foundational software artifacts endure across decades of computing changes. While user interfaces and high-level application frameworks undergo constant redesigns, core utilities like cat survive because their underlying mechanics reliably solve fundamental data-handling tasks. Code written thirty or fifty years ago remains actively deployed under the surface of modern operating systems.

AI-generated editorial illustration; not a documentary photograph.

Source: 0b10

0b10

The Source History of Cat

Share this article
FacebookThreadsLinkedInX

Leave a Reply

Your email address will not be published. Required fields are marked *