ED(1) OpenBSD Reference Manual ED(1)
NAME
ed - text editor
SYNOPSIS
ed [-] [-sx] [-p string] [file]
DESCRIPTION
ed is a line-oriented text editor. It is used to create, display, modi-
fy, and otherwise manipulate text files. If invoked with a file argu-
ment, then a copy of file is read into the editor's buffer. Changes are
made to this copy and not directly to file itself. Upon quitting ed, any
changes not explicitly saved with a w command are lost.
Editing is done in two distinct modes: command and input. When first in-
voked, ed is in command mode. In this mode, commands are read from the
standard input and executed to manipulate the contents of the editor
buffer.
A typical command might look like:
,s/old/new/g
which replaces all occurrences of the string old with new.
[...]