uTools-Manuals/docs/linux/enable.html
2019-04-21 11:50:48 +08:00

75 lines
2.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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="enable">enable</h1>
<p>启动或关闭shell内建命令</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>enable命令</strong> 用于临时关闭或者激活指定的shell内部命令。若要执行的文件名称与shell内建命令相同可用<code>enable -n</code>来关闭shell内建命令。若不加<code>-n</code>选项enable可重新启动关闭的命令。</p>
<p>linux shell命令执行时shell总是先在自己的shell builtin中查找该命令如果找到则执行该命令如果找不到该命令则会从环境变量$PATH指定的路径中依次去查找待执行的命令。因为了解了这一点所以看起来好像没有办法编写用户自己的命令来替代shell builtin命令。幸运的是有了enable命令我们就能做到了。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">enable(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-n关闭指定的内部命令
-a显示所有激活的内部命令
-f从指定文件中读取内部命令。</code></pre>
<h3 id="参数">参数</h3>
<p>内部命令:指定要关闭或激活的内部命令。</p>
<h3 id="实例">实例</h3>
<p>使用enable命令显示所有激活的内部命令</p>
<pre><code class="language-bash">[root@localhost ~]# enable -a
enable .
enable :
enable alias
enable bg
enable bind
enable break
enable builtin
enable caller
enable cd
enable command
enable compgen
enable complete
enable continue
enable declare
enable dirs
enable disown
enable echo
enable enable
enable eval
enable exec
enable exit
enable export
enable false
enable fc
enable fg
enable getopts
enable hash
enable help
enable history
enable jobs
enable kill
enable let
enable local
enable logout
enable popd
enable printf
enable pushd
enable pwd
enable read
enable readonly
enable return
enable set
enable shift
enable shopt
enable source
enable suspend
enable test
enable times
enable trap
enable true
enable type
enable typeset
enable ulimit
enable umask
enable unalias
enable unset
enable wait</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->