ed - Man Page
line-oriented text editor
Examples (TL;DR)
- Start ed, editing an empty document (which can be saved as a new file in the current directory):
ed
- Start ed, editing an empty document, with
:
as a command prompt indicator:ed -p :
- Start ed editing an existing file (this shows the byte count of the loaded file):
ed -p : path/to/file
- Toggle the printing of error explanations. (By default, explanations are not printed and only a
?
appears):H
- Add text to the current document. Mark completion by entering a period by itself in a new line:
a<Enter>text_to_insert<Enter>.
- Print the entire document (
,
is a shortcut to the range1,$
which covers the start to the end of the document):,p
- Write the current document to a new file (the filename can be omitted if
ed
was called with an existing file):w filename
- Quit ed:
q
Synopsis
ed [options] [file]
Description
GNU Ed - The GNU line editor.
Options
- -h, --help
display this help and exit
- -V, --version
output version information and exit
- -G, --traditional
run in compatibility mode
- -l, --loose-exit-status
exit with 0 status even if a command fails
- -p, --prompt=STRING
use STRING as an interactive prompt
- -r, --restricted
run in restricted mode
- -s, --quiet, --silent
suppress diagnostics, byte counts and '!' prompt
- -v, --verbose
be verbose; equivalent to the 'H' command
Start edit by reading in 'file' if given. If 'file' begins with a '!', read output of shell command.
Exit status: 0 for a normal exit, 1 for environmental problems (file not found, invalid flags, I/O errors, etc), 2 to indicate a corrupt or invalid input file, 3 for an internal consistency error (eg, bug) which caused ed to panic.
Reporting Bugs
Report bugs to bug-ed@gnu.org
Ed home page: http://www.gnu.org/software/ed/ed.html
General help using GNU software: http://www.gnu.org/gethelp
Copyright
Copyright © 1994 Andrew L. Moore.
Copyright © 2017 Antonio Diaz Diaz. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
See Also
The full documentation for ed is maintained as a Texinfo manual. If the info and ed programs are properly installed at your site, the command
info ed
should give you access to the complete manual.
Referenced By
alternatives(8), cdist-type__sensible_editor(7), dash(1), mailx.mailx(1), mc(1), med(1), mksh(1), opax(1), patch(1), pick(1), rc(1), rdist(1), regex(7), sed(1), spax(1), star(1), tcsh(1), xs(1).
The man page red(1) is an alias of ed(1).