LINUX-Centos7之后修改默认启动界面为命令界面或者图形界面的方法

很多博客的文章比较老了,这里更新一下

老方法:vim /etc/inittab

# 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

以上说明,这个文档已经被废弃了,即使修改也不产生任何作用

老式系统运行级别的说法已经被抛弃了,也就是不存在1-6个运行级别的说法了。


1.查看当前默认启动界面命令:

systemctl get-default

2.修改默认启动界面为图形界面
systemctl set-default   graphical.target

3.修改默认启动界面为命令界面
systemctl set-default  multi-user.target

重启

shutdown -h now

你可能感兴趣的:(LINUX-Centos7之后修改默认启动界面为命令界面或者图形界面的方法)