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

18 lines
1.0 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="halt">halt</h1>
<p>关闭正在运行的Linux操作系统</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>halt命令</strong> 用来关闭正在运行的Linux操作系统。halt命令会先检测系统的runlevel若runlevel为0或6则关闭系统否则即调用shutdown来关闭系统。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">halt(选项)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-d不要在wtmp中记录
-f不论目前的runlevel为何不调用shutdown即强制关闭系统
-i在halt之前关闭全部的网络界面
-nhalt前不用先执行sync
-phalt之后执行poweroff
-w仅在wtmp中记录而不实际结束系统。</code></pre>
<h3 id="实例">实例</h3>
<pre><code class="language-bash">halt -p //关闭系统后关闭电源。
halt -d //关闭系统,但不留下纪录。</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->