systemctl get-default #查看系统启动进入默认模式
systemctl set-default graphical.target #改成默认进入 图形界面模式
systemctl set-default multi-user.target #改成默认进入命令行模式
==================================
[root@localhost ~]# systemctl set-default multi-user.target Removed symlink /etc/systemd/system/default.target. Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.
=====================================
网上各种策略将编辑 inittab文件,从 5--》3即可,centos 7 之后 用系统
graphical.target
"/etc/inittab" 17L, 511C 17,1 全部 # 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