# ed

单行纯文本编辑器

## 补充说明

**ed命令** 是单行纯文本编辑器，它有命令模式（command mode）和输入模式（input mode）两种工作模式。ed命令支持多个内置命令，常见内置命令如下：

### 语法

```
ed(选项)(参数)
```

### 选项

```
A # 切换到输入模式，在文件的最后一行之后输入新的内容；
C # 切换到输入模式，用输入的内容替换掉最后一行的内容；
i # 切换到输入模式，在当前行之前加入一个新的空行来输入内容；
d # 用于删除最后一行文本内容；
n # 用于显示最后一行的行号和内容；
w # <文件名>：一给定的文件名保存当前正在编辑的文件；
q # 退出ed编辑器。
```

```
-G或——traditional：提供兼容的功能；
-p<字符串>：指定ed在command mode的提示字符；
-s，-，--quiet或——silent：不执行开启文件时的检查功能；
--help：显示帮助；
--version：显示版本信息。
```

### 参数

文件：待编辑的文件。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hezhiqiang.gitbook.io/linux/ming-ling/ed.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
