zoukankan      html  css  js  c++  java
  • centos设置开机进入桌面模式或命令行模式

    centos6 设置

    vi /etc/inittab  修改最后一行

    3表示命令行模式 , 5表示图形界面

    修改后wq保存退出,重启后进入相应的模式。

    # inittab is only used by upstart for the defult runlevel.
    #
    # ADDING OTHER CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM.
    #
    # System initialization is started by /etc/init/rcS.conf
    #
    # Individual runlevels are started by /etc/init/rc.conf
    #
    # Ctrl-Alt-Delete is handled by /etc/init/control-alt-delete.conf
    #
    # Terminal gettys are handled by /etc/init/tty.conf and /etc/init/serial.conf,
    # with configuration in /etc/sysconfig/init.
    #
    # For information on how to write upstart event handlers, or how
    # upstart works, see init(5), init(8), and initctl(8).
    #
    # Default runlevel. The runlevels used are:
    #   0 - halt (Do NOT set initdefault to this)
    #   1 - Single user mode
    #   2 - Multiuser, without NFS (The same as 3, if you do not have networking)
    #   3 - Full multiuser mode
    #   4 - unused
    #   5 - X11
    #   6 - reboot (Do NOT set initdefault to this)
    #
    id:3:initdefault:

    centos7 设置

    centos7 不再使用inittab了

    执行 vi /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
    #

    multi-user.target : 运行级别3(命令行)

    graphical.target : 运行级别5(图形界面)

    查看当前运行级别:

    systemctl get-default

    设置开机进入命令行:

    systemctl set-default multi-user.target

    设置开机进入图形界面:

    systemctl set-default graphical.target

    设置后重启即可。

  • 相关阅读:
    在R语言中轻松创建关联网络
    在R语言中显示美丽的数据摘要summary统计信息
    R语言中不同类型的聚类方法比较
    R语言中的划分聚类模型
    R语言解释生存分析中危险率和风险率的变化
    Stata估算观测数据的风险比
    Stata 中Mata的st_view函数
    R语言多臂试验
    R语言使用倾向评分提高RCT(随机对照试验)的效率
    R语言在RCT中调整基线时对错误指定的稳健性
  • 原文地址:https://www.cnblogs.com/dch0/p/11814048.html
Copyright © 2011-2022 走看看