ed

ed is the original line-oriented text editor of the Unix system, written by Ken Thompson in the early days of Unix at Bell Labs. The Seventh Edition Unix manual page, preserved in the Unix Heritage Society’s source tree, gives its NAME simply as “ed - text editor” and its description opens with the famous line: “Ed is the standard text editor.” The SYNOPSIS shows its terse invocation, ed [ - ] [ -x ] [ name ], reflecting an editor designed for the printing terminals and slow connections of its era rather than for full-screen displays.

ed operates on a copy of the file held in a temporary buffer; edits accumulate in that buffer and only reach disk when an explicit write command is issued. Commands follow a compact grammar of an optional line address (or range of addresses) followed by a single command letter and optional parameters, for example to print, substitute, delete, or append text. The editor is modal in a minimal sense, distinguishing a command mode from an input mode entered for adding text. This addressing-plus-command structure made ed scriptable and predictable even when the user could not see the whole file at once.

ed’s deepest legacy is its regular-expression machinery for matching and substituting text within lines. The pattern syntax and the substitute command it established were carried into the stream editor sed and into the pattern-searching tool grep, whose very name derives from the ed command form g/re/p (globally search for a regular expression and print). Through these tools, ed’s regex conventions propagated across Unix and into countless later languages and utilities.

ed also sits at the root of the screen-editor family that dominates Unix to this day. Its command set was extended into the line editor ex, and ex in turn gained a full-screen visual mode that became vi, with vi’s modal command language and Ex commands both descending directly from ed. Vim and Neovim continue to honor this ancestry: their Command-line mode runs Ex commands, and many of their colon commands behave just as ed’s line commands did. Though rarely used interactively now, ed remains installed on Unix-like systems as a minimal, dependency-free editor and as a piece of living computing history.

Sources

Last verified June 8, 2026