CentOS 默认进入图形界面与文本界面

查看/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

所以设置默认进入图形界面的命令是:systemctl set-default graphical.target

所以设置默认进入文本界面的命令是:systemctl set-default multi-user.target

如果你想在图形界面下进入文本界面,由于我的机器图形界面在ctrrl+alt+f1下,我输入ctrl+alt+f2-f7都能进入文本界面,如果想删除x-windows相关服务,pa -ax | grep X,找出相关的服务,kill -9 pid.

 

http://bbs.csdn.net/topics/370262017

消去开机的图片:

grub2-efi:

  vim /etc/default/grub

  删除rhgb quiet 保存退出

  grub2-mkconfig -o /etc/grub2-efi.cfg

  ok

grub2和mbr:

  vim /etc/default/ 这个目录下也有一个类似的文件,修改方法同上

  grub2-mkconfig -o /boot/grub2/grub.cfg    ;查看下有没有这个文件,应该在这个目录下,具体位置不记清了。

    解释:
 
    rhgb:用图片来代替启动过程中的文本信息,这些文本信息在启动完成后可以用dmesg查看。
 
  rhgb = redhat graphical boot - This is a GUI mode booting screen with
      most of the information hidden while the user sees a rotating activity
       icon spining and brief information as to what the computer is doing.
 
  quite:在启动过程中只显示重要信息,类似硬件自检的消息不回显。
  quiet = hides the majority of boot messages before rhgb starts. These
      are supposed to make the common user more comfortable. They get alarmed
      about seeing the kernel and initializing messages, so they hide them for
      their comfort.
 
 

http://www.cnblogs.com/lvfeilong/p/234rfdsfds.html

rm -f /etc/systemd/system/default.target

设置命令行级别方法:
ln -sf /lib/systemd/system/runlevel3.target /etc/systemd/system/default.target

ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

systemctl set-default multi-user.target

改回窗口级别方法:
ln -sf /lib/systemd/system/runlevel5.target /etc/systemd/system/default.target

ln -sf /lib/systemd/system/graphical.target /etc/systemd/system/default.target

systemctl set-default graphical.target



原文地址:https://www.cnblogs.com/little-snake/p/4609417.html