news
A Deep Dive into the ed Text Editor
There's a long-running joke, a shibboleth tossed at new users, that "ed is the standard editor". This is often said with a wry smile, as ed is notoriously user-unfriendly. Its default state is a blank line, it offers no prompt, and its only error message is a single, cryptic ?.
But the secret, and the reason the joke has such staying power, is that it's fundamentally true. For early Unix, ed was the standard text editor. To this day, it remains a required component of the POSIX standard, meaning it's present on virtually every Unix-like system on earth.
In an age of "over-engineered IDEs" and "kitchen sink" configurations, ed represents a different path. Its brutal simplicity isn't a flaw; it's a design philosophy. This deep dive will explore the power and elegance of ed.
For the uninitiated, ed's a line-oriented and modal text editor. This means you don't see or edit a full screen of text. You operate, by default, on one line at a time using a precise set of commands. It's this command-driven nature that unlocks its true potential.
To understand ed, one must be transported to August 1969 at AT&T Bell Labs. Ken Thompson, a co-author of Unix, was working on a PDP-7 and developed the three primordial elements of this new OS: the assembler, the editor, and the shell. That original editor was ed.