Ed Text Editor Summary
Line Addressing Summary:
Address Symbol
Description
.
The current line (address) in the buffer.
$
The last line in the buffer.
n
The nth, line in the buffer where n is a number in the range [0,$].
-
^
The previous line. This is equivalent to -1 and may be repeated with cumulative effect.
-n
^n
The nth previous line, where n is a non-negative number.
+
The next line. This is equivalent to +1 and may be repeated with cumulative effect.
+n
whitespace n
The nth next line, where n is a non-negative number.
Whitespace followed by a number n is interpreted as +n.
,
%
The first through last lines in the buffer. This is equivalent to the address range 1,$.
;
The current through last lines in the buffer. This is equivalent to the address range .,$.
/re/
The next line containing the regular expression re.
The search wraps to the beginning of the buffer and continues down to the current line, if necessary.
// repeats the last search.
?re?
The previous line containing the regular expression re.
The search wraps to the end of the buffer and continues up to the current line, if necessary.
?? repeats the last search.
´lc
The line previously marked by a `k' (mark) command, where lc is a lower case letter.
Each address in a comma-delimited range is interpreted relative to the current address.
In a semicolon-delimited range, the 1st address is used to set the current address, and the 2nd address is interpreted relative to the first.
Command Summary:
Command
Description
(.)a
Appends text to the buffer after the addressed line, which may be the address 0 (zero). Text is entered in
input mode. The current address is set to last line entered.
(.,.)c
Changes lines in the buffer. The addressed lines are deleted from the buffer, and text is appended in their
place. Text is entered in input mode. The current address is set to last line entered.
(.,.)d
Deletes the addressed lines from the buffer. If there is a line after the deleted range, then the