关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

Linux中使用init命令关机、重启、切换模式

发布时间:2023/7/18 15:24:56
香港云服务器

Linux中使用init命令关机、重启、切换模式

Linux有个文件 ? /etc/inittab

复制代码代码如下:

#

# inittab This file describes how the INIT process should set up

# the system in a certain run-level.

#

# Author: Miquel van Smoorenburg, 

# Modified for RHS Linux by Marc Ewing and Donnie Barnes

# Default runlevel. The runlevels used by RHS are:

# 0 - halt (Do NOT set initdefault to this)

# 1 - Single user mode

# 2 - Multiuser, without NFS (The same as 3, if you do not have networking)

# 3 - Full multiuser mode

# 4 - unused

# 5 - X11

# 6 - reboot (Do NOT set initdefault to this)

#

id:3:initdefault:

0是关机

1是单用户

2是多用户,不联网

3是多用户

4是不使用的

5是xwindows,也就是有界面的

6是重启

init命令很简单。直接输入init + 你想要的模式 ?回车就行。

比如 输入 ?: ?init 0 ? 就是关机

init 3 ?就是切换到多用户

init 5 ?就是切换到界面

init 6 ?就是重启