TrumanWong

ed

Single line plain text editor

Supplementary instructions

ed command is a single-line plain text editor. It has two working modes: command mode and input mode. The ed command supports multiple built-in commands. Common built-in commands are as follows:

grammar

ed(option)(parameter)

Options

A # Switch to input mode and enter new content after the last line of the file;
C # Switch to input mode and replace the content of the last line with the input content;
i # Switch to input mode and add a new blank line before the current line to input content;
d # is used to delete the last line of text content;
n # Used to display the line number and content of the last line;
w # <file name>: A given file name saves the file currently being edited;
q # Exit the ed editor.
-G or --traditional: provide compatible functions;
-p<string>: Specifies the prompt character for ed in command mode;
-s, -, --quiet or --silent: do not perform the check function when opening the file;
--help: display help;
--version: Display version information.

Parameters

File: The file to be edited.