ED(1) General Commands Manual ED(1)

edline editor

ed [-h] [-l] [-p string] [-s] [-v] [-V] [file]


The ed utility is a line-based text editor. It can be used create, display, modifiy, and otherwise manipulate text files interactively or via a script. () Note that this man page is used to note implementation details for this specific implementation. See ed(1p) for a detailed description of available commands and an overview of usage.

Display simplified usage information.
Use a “loose exit status”. Even if a command has an error (a failed regex, for instance) exit successfully. Useful when using ed as an editor for git(1) or cron(8), where a failure exit status could discard all modifications, even if they were valid.
Use string as the prompt string when in command mode. It can be toggled on and off with the command.
Suppress diagnostics (if enabled), byte counts displayed when reading and writing, and the “!” prompt. Should be used if ed's standard input is from a script.
Output verbose error messages. Equivalent to the command.
Display version and copyright information.
Specify a filename to read into the buffer. The default filename will be set to file. Essentially, it will act as if the command had been provided on the given file before accepting commands from stdin.


Michael W Lucas, Ed Mastery: The Standard Unix Text Editor, Tilted Windmill Press, April 1, 2018.

This implementation of ed conforms to IEEE Std 1003.1-2008 (“POSIX.1”) in almost all cases where said standard is applicable. However, the -l flag in violation of the standard: "Some historical implementations returned exit status zero even if command errors had occurred; this is not allowed by this volume of POSIX.1-2008."

Documentation and software by nytpu <alex@nytpu.com>

ed makes use of linenoise(3), by Salvatore Sanfilippo <antirez at gmail dot com> and Pieter Noordhuis <pcnoordhuis at gmail dot com>.

The upstream URL of this project is ⟨https://git.nytpu.com/ed⟩. Send suggestions, bugs, and other contributions to <alex@nytpu.com>. For help sending a patch through email, see ⟨https://git-send-email.io⟩.

This implementation of ed does not implement the red restricted editor. It is the opinion of the author that the usefulness of red is obviated by modern security considerations and the fact that using ed as the default editor on a contemporary system is very unlikely. The author recommends using a chroot(1) jail if preventing a user from running commands or editing outside the current directory is desired. This would then allow the user to use their editor of choice, such as vi(1) as well as ed.

June 4, 2021 Linux 5.18.5-arch1-1