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

27 lines
1.6 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="init">init</h1>
<p>init进程是所有Linux进程的父进程</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>init命令</strong> 是Linux下的进程初始化工具init进程是所有Linux进程的父进程它的进程号为1。init命令是Linux操作系统中不可缺少的程序之一init进程是Linux内核引导运行的是系统中的第一个进程。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">init(选项)(参数)</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-b不执行相关脚本而直接进入单用户模式
-s切换到单用户模式。</code></pre>
<h3 id="参数">参数</h3>
<p>运行等级指定Linux系统要切换到的运行等级。</p>
<h3 id="实例">实例</h3>
<p>几个常用的命令</p>
<p>查看系统进程命令:<code>ps -ef | head</code><br />
查看init的配置文件<code>more /etc/inittab</code><br />
查看系统当前运行的级别:<code>runlevel</code></p>
<p><strong>运行级别</strong></p>
<p>到底什么是运行级呢简单的说运行级就是操作系统当前正在运行的功能级别。这个级别从0到6 ,具有不同的功能。你也可以在<code>/etc/inittab</code>中查看它的英文介绍。</p>
<pre><code class="language-bash">#0 停机千万不能把initdefault 设置为0
#1 单用户模式
#2 多用户,没有 NFS(和级别3相似会停止部分服务)
#3 完全多用户模式
#4 没有用到
#5 x11(Xwindow)
#6 重新启动千万不要把initdefault 设置为6</code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->