正在學(xué)習(xí)Linux中。。。一邊學(xué)一邊記錄著。。所有觀點(diǎn)只是個(gè)人觀點(diǎn)
Linux有個(gè)文件 /etc/inittab
#
# inittab This file describes how the INIT process should set up
# the system in a certain run-level.
#
# Author: Miquel van Smoorenburg, miquels@drinkel.nl.mugnet.org>
# Modified for RHS Linux by Marc Ewing and Donnie Barnes
#/p>
p># 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是關(guān)機(jī)
1是單用戶
2是多用戶,不聯(lián)網(wǎng)
3是多用戶
4是不使用的
5是xwindows,也就是有界面的
6是重啟
init命令很簡(jiǎn)單。直接輸入init + 你想要的模式 回車就行。
比如 輸入 : init 0 就是關(guān)機(jī)
init 3 就是切換到多用戶
init 5 就是切換到界面
init 6 就是重啟
![](/d/20211018/933b10fd4996060b4dcbdb2f224667ea.gif)
我實(shí)驗(yàn)的時(shí)候都是在root用戶下進(jìn)行的,不知道其它用戶可不可以,再實(shí)驗(yàn)實(shí)驗(yàn)。