ed(itor) manual
Commands
Note: [] is optional arguments.
[f,l]p (print): Prints the contents of the first to the last line.
If f or is not specified, the current line is used. If l is not specified, the l argument will be equals to f
Changes the current line to the last printed line
[f,l]n (print with number): Prints the line number and the contents of the first to the last line.
If f or is not specified, the current line is used. If l is not specified, the l argument will be equals to f
Changes the current line to the last printed line
[f,l]l (list): Prints the contents of the first to the last line followed by a '$' symbol.
If f or is not specified, the current line is used. If l is not specified, the l argument will be equals to f
Changes the current line to the last listed line
h (show error): Shows a detailed version of the error.
H (show error and don't surpress any errors): In every error that will occur, don't try to send a error emoji, also prints the last error.
q (quit): Quits from $ed.
Q (forced quit): Quits from $ed without any buffer warning.
w (write): Sends all the contents of the internal $ed buffer.
wq (write & quit): Sends all the contents of the internal $ed buffer and quit.
[f,l]g/re/command (search): Run the specified command if any line from first to the last parameter matches the regular expression (re).
If f is not specified, will use the first line as beggining. If l is not specified, the last line is used.
Changes the current line to the last match
[f,l]r/re/new (replace): Replaces the lines from first to the last lines if the regular expression (re) matches.
If f is not specified, will use the first line as beggining. If l is not specified, the last line is used.
Changes the current line to the last match
[B]+n (advance lines): Advances B+n lines. If N is not specified, will use the current line.
Changes the current line
[B]-n (return lines): Return B-n lines. If N is not specified, will use the current line.
Changes the current line
[n]a (append): Appends one or more lines starting at line n. If N is not specified, will use the current line.
If a single 'dot' is sent to the command. The command stops. Note: line (n as) zero is supported.
Changes the current line to the last affected line.
[n]i (insert): Inserts one or more lines starting at line n. If N is not specified, will use the current line.
If a single 'dot' is sent to the command. The command stops
Changes the current line to the last affected line.
[f,l]c (change): Changes one or more lines starting at line f and stops at line l. After that the command will become a append/insert command
If f or is not specified, the current line is used. If l is not specified, the l argument will be equals to f
If a single 'dot' is sent to the command. The command stops
Changes the current line to the last affected line.
[f,l]d (delete): Deletes one or more lines starting at line f and stops at line l.
If f or is not specified, the current line is used. If l is not specified, the l argument will be equals to f
n (any number): Changes the current line to n.