mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-03-04 03:50:35 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -5,9 +5,9 @@
|
||||
<p>该命令单独使用时,仅显示历史命令,在命令行中,可以使用符号<code>!</code>执行指定序号的历史命令。例如,要执行第2个历史命令,则输入<code>!2</code>。</p>
|
||||
<p>历史命令是被保存在内存中的,当退出或者登录shell时,会自动保存或读取。在内存中,历史命令仅能够存储1000条历史命令,该数量是由环境变量<code>HISTSIZE</code>进行控制。</p>
|
||||
<h3 id="语法">语法</h3>
|
||||
<pre><code>history(选项)(参数)</code></pre>
|
||||
<pre><code class="language-bash">history(选项)(参数)</code></pre>
|
||||
<h3 id="选项">选项</h3>
|
||||
<pre><code>-c:清空当前历史命令;
|
||||
<pre><code class="language-bash">-c:清空当前历史命令;
|
||||
-a:将历史命令缓冲区中命令写入历史命令文件中;
|
||||
-r:将历史命令文件中的命令读入当前历史命令缓冲区;
|
||||
-w:将当前历史命令缓冲区命令写入历史命令文件中。</code></pre>
|
||||
@@ -15,7 +15,7 @@
|
||||
<p>n:打印最近的n条历史命令。</p>
|
||||
<h3 id="实例">实例</h3>
|
||||
<p>使用history命令显示最近使用的10条历史命令,输入如下命令:</p>
|
||||
<pre><code>[root@localhost ~]# history 10
|
||||
<pre><code class="language-bash">[root@localhost ~]# history 10
|
||||
92 ls
|
||||
93 cd ..
|
||||
94 ls
|
||||
@@ -27,14 +27,14 @@
|
||||
100 exit
|
||||
101 history 10</code></pre>
|
||||
<p>列出最近3条记录</p>
|
||||
<pre><code>[root@localhost ~]# history 3
|
||||
<pre><code class="language-bash">[root@localhost ~]# history 3
|
||||
15 2017-08-26 11:44:35 root history 3
|
||||
16 2017-08-26 11:44:37 root history n
|
||||
17 2017-08-26 11:44:40 root history 3</code></pre>
|
||||
<p>清空历史记录</p>
|
||||
<pre><code>[root@localhost ~]# history -c</code></pre>
|
||||
<pre><code class="language-bash">[root@localhost ~]# history -c</code></pre>
|
||||
<p>更多实例:</p>
|
||||
<pre><code>history -cw
|
||||
<pre><code class="language-bash">history -cw
|
||||
`~/.bash_history`: 保存历史命令
|
||||
`/etc/profile` -> HISSIZE: 历史命令保存数量
|
||||
推荐添加 h -> history, hsi -> history|grep 别名
|
||||
|
||||
Reference in New Issue
Block a user