2019-04-21 11:50:48 +08:00

23 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="ed">ed</h1>
<p>单行纯文本编辑器</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>ed命令</strong> 是单行纯文本编辑器它有命令模式command mode和输入模式input mode两种工作模式。ed命令支持多个内置命令常见内置命令如下</p>
<pre><code class="language-bash">A切换到输入模式在文件的最后一行之后输入新的内容
C切换到输入模式用输入的内容替换掉最后一行的内容
i切换到输入模式在当前行之前加入一个新的空行来输入内容
d用于删除最后一行文本内容
n用于显示最后一行的行号和内容
w&lt;文件名&gt;:一给定的文件名保存当前正在编辑的文件;
q退出ed编辑器。</code></pre>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">ed(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-G或——traditional提供兼容的功能
-p&lt;字符串&gt;指定ed在command mode的提示字符
-s---quiet或——silent不执行开启文件时的检查功能
--help显示帮助
--version显示版本信息。</code></pre>
<h3 id="参数">参数</h3>
<p>文件:待编辑的文件。</p>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->