centos 命令行/图形界面启动设置

1. 介绍

        关闭centos的图形界面,可以节省一部分硬件资源,让系统跑的更流畅,本文就介绍centos配置命令行/图形界面的启动模式。

        一般情况,Linux可以通过修改runlevel的级别来配置启动的模式,centos目前支持level3 /5 两种模式,且可命令配置。

2. 配置 

查看配置文件及说明

[centos@localhost ~]$ 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

由上面配置信息,通过命令行设置启动模式

# 获取当前启动模式
systemctl get-default

# 命令行模式
systemctl set-default multi-user.targ

你可能感兴趣的:(基础环境部署,centos,vim,linux)