ed is a line-oriented text editor for Unix. Use this tag for questions related to ed scripting; questions about interactive usage are considered off-topic.
ed was created in 1969 by Ken Thompson as a simplified successor to the QED editor and was part of the first version of Unix. It is still part of the POSIX standard.
Unlike visual ("full-screen") editors such as vi/vim, ed is a line editor. It pioneered and influenced many features seen in popular tools such as grep, sed, ex, and vi/vim.
ed commands can be stored in scripts; notably, the diff
tool can be set to generate ed commands when using the -e
command line option.
Questions about scripting with ed are likely to be suitable for Stack Overflow; questions about interactive usage might be better suited for Unix & Linux or Super User.
References
- POSIX spec for ed
- GNU ed
- Unix V1 manual (ed on page 7)
- A Tutorial Introduction to the UNIX Text Editor by Brian W. Kernighan
- Advanced Editing on UNIX by Brian W. Kernighan
- Ed Mastery by Michael W Lucas
- Editing files via scripts with ed on the Bash Hackers Wiki
- How can I replace a string with another string in a variable, a stream, a file, or in all the files in a directory? from the BashFAQ