Commands

(.)a
Appends text to the buffer after the addressed line. The address ‘0’ (zero) is valid for this command; it places the entered text at the beginning of the buffer. Text is entered in input mode. The current address is set to the address of the last line entered or, if there were none, to the addressed line.

(.,.)c
Changes lines in the buffer. The addressed lines are deleted from the buffer, and text is inserted in their place. Text is entered in input mode. The current address is set to the address of the last line entered or, if there were none, to the new address of the line after the last line deleted; if the lines deleted were originally at the end of the buffer, the current address is set to the address of the new last line; if no lines remain in the buffer, the current address is set to zero. The lines deleted are copied to the cut buffer.

(.,.)d
Deletes the addressed lines from the buffer. The current address is set to the new address of the line after the last line deleted; if the lines deleted were originally at the end of the buffer, the current address is set to the address of the new last line; if no lines remain in the buffer, the current address is set to zero. The lines deleted are copied to the cut buffer.

f file
Sets the default filename to file, whether or
not file names an existing file. If file is not
specified, then the default filename is printed.

(.)i
Inserts text in the buffer before the addressed line. The address ‘0’ (zero) is valid for this command; it places the entered text at the beginning of the buffer. Text is entered in input mode. The current address is set to the address of the last line entered or, if there were none, to the addressed line.(.)i Inserts text in the buffer before the addressed line. The address ‘0’ (zero) is valid for this command; it places the entered text at the beginning of the buffer. Text is entered in input mode. The current address is set to the address of the last line entered or, if there were none, to the addressed line.

(.,.)m(.)
Moves lines in the buffer. The addressed lines are moved to after the right-hand destination address. The destination address ‘0’ (zero) is valid for this command; it moves the addressed lines to the beginning of the buffer. It is an error if the destination address falls within the range of lines to be moved. The current address is set to the new address of the last line moved.

(.,.)p
Prints the addressed lines.

($)r file
Reads file and appends it after the addressed
line.

(1,$)w file
Writes the addressed lines to file,
automatically creating any missing parent
directories.

(1,$)wq file
Writes the addressed lines to file, and then executes a ‘q’ command.

(1,$)W file
Appends the addressed lines to the end of file.

(.)x
Copies (puts) the contents of the cut buffer to after the addressed line. The current address is set to the address of the last line copied.

(.,.)y
Copies (yanks) the addressed lines to the cut buffer.

!command
Shell escape command. Executes command via sh.