您好,登錄后才能下訂單哦!
1.目的
因為圖形界面比較占用資源,在部署中為了不浪費資源,我們一般使用命令行界面,有需要的時候使用命令startx切換到圖形界面
2.查看/etc/inittab文件,cat /etc/inittab
[root@zabbix-elk ~]# cat /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
#
3.查看當前默認模式
使用命令:systemctl get-default查看
[root@zabbix-elk ~]# systemctl get-default
multi-user.target
[root@zabbix-elk ~]#
4.設置默認模式
使用命令:systemctl set-default TARGET.target設置默認模式
systemctl set-default multi-user.target
systemctl set-default graphical.target
[root@zabbix-elk ~]# systemctl set-default multi-user.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target.
[root@zabbix-elk ~]# systemctl set-default graphical.target
Removed symlink /etc/systemd/system/default.target.
Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target.
5.重啟驗證
命令行模式切換到圖形界面運行命令:startx
圖形界面切換到命令行界面使用:CTRL+ALT+F3
命令行界面切換到圖形界面使用:CTRL+ALT+F5
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。