Linux Fedora设置启动级别

时间:2022-06-23 20:13:59

默认运行级别为5:X-Window窗口模式

命令行模式:3(多用户模式)

  • 通过如下命令查看运行模式
    cat /etc/inittab
# inittab is no longer used.
#
# 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
  • 从以上内容中可以看出,新版的Fedora运行级别已经不再这个文件中设置了,使用如下命令:
  • 图形化启动:systemctl set-default graphical.target
  • 命令行启动:systemctl set-default multi-user.target