0 - 系统停机状态1 - 单用户工作状态2 - 多用户状态3 - 多用户状态4 - 系统未使用,留给用户5 - 图形界面6 - 系统正常关闭并重新启动
2、centos7的inittab: :可以看到,centos7并没有centos6中设置默认运行级别的方式。
# inittab is no longer used when using systemd.## ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.## Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target## systemd uses 'targets' instead of runlevels、By default, there are two main targets:## multi-user.target: analogous to runlevel 3# graphical.target: analogous to runlevel 5## To view current default target, run:# systemctl get-default## To set a default target, run:# systemctl set-default TARGET.target#htfa:35:respawn:/etc/init.d/init.tfa run >/dev/null 2>&1
根据注释:
multi-user.target等同于runlevel 3;graphical.target等同于runlevel 5;
:查看当前运行级别
systemctl get-default
:多用用户切换到图形化
systemctl set-default graphical.target
:图形化切换到多用户
systemctl set-default multi-user.target