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

38 lines
1.7 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="bind">bind</h1>
<p>显示或设置键盘按键与其相关的功能</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>bind命令</strong> 用于显示和设置命令行的键盘序列绑定功能。通过这一命令可以提高命令行中操作效率。您可以利用bind命令了解有哪些按键组合与其功能也可以自行指定要用哪些按键组合。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">bind(选项)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-d显示按键配置的内容
-f&lt;按键配置文件&gt;:载入指定的按键配置文件;
-l列出所有的功能
-m&lt;按键配置&gt;:指定按键配置;
-q&lt;功能&gt;:显示指定功能的按键;
-v列出目前的按键配置与其功能。</code></pre>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">bind -x &#39;&quot;\C-l&quot;:ls -l&#39; #直接按 CTRL+L 就列出目录</code></pre>
<p>其中keyseq可以使用<code>showkey -a</code>命令来获取:</p>
<pre><code class="language-bash">[root@localhost ~]# showkey -a
Press any keys - Ctrl-D will terminate this program
^[[A 27 0033 0x1b 上
91 0133 0x5b
65 0101 0x41
^[[B 27 0033 0x1b 下
91 0133 0x5b
66 0102 0x42
^[[D 27 0033 0x1b 左
91 0133 0x5b
68 0104 0x44
^[[C 27 0033 0x1b 右
91 0133 0x5b
67 0103 0x43
32 0040 0x20
^M 13 0015 0x0d 字母M
^C 3 0003 0x03 Ctrl-C
^D 4 0004 0x04 Ctrl-D 退出</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->