在root用户权限下:
查看当前启动模式
# systemctl get-default
更改模式命令:
systemctl set-default graphical.target由命令行模式更改为图形界面模式
systemctl set-default multi-user.target由图形界面模式更改为命令行模式
附:
跟以前使用的linux版本一样,编辑 vi /etc/inittab 文件,修改系统初始化方式,却发现centos已经变了:
# 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
可以发现,inittab文件已经不再使用了,而是使用systemd了。
multi-user.target多用户界面,类似以前的level3
graphical.target图形界面,类似以前的level5