Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to quickly switch between text mode and X environment in linux system

Shulou Source: shulou.com Published: 2022-06-01 19:12:43 10月29日 Update

This article will explain in detail how the linux system can quickly switch between text mode and X environment. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.

Linux is not as good as redhat switching, but we can make our own script to quickly switch between the two environments. Let's take a look at the detailed tutorial.

1. In the linux desktop environment, press CTRL+ALT+T to open the terminal at the same time.

2. Then create a script file for myinit.sh.

3. Set executable permissions to myinit.sh.

4. Open myinit.sh with vim.

5. Enter the following:

If [$#! = 1]; then echo "myinit.sh 3-> used to deepin cmdline" echo "myinit.sh 5-> used to deepin X" exitfiif [[$1 = = 3]]; then sudo systemctl disable lightdmfiif [[$1 = = 5]]; then sudo systemctl disable lightdmfisudo shutdown-r now

6. If you want to enter the dde desktop environment in text mode, directly execute. / myinit.sh 5

7. If you are in dde desktop environment, you can also enter text mode.

. / myinit.sh 3

Privileges need to be elevated in the script, so you need to enter a password.

This is the end of the article on "how to quickly switch text mode and X environment in linux system". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.

Tags: Environment text mode switching desktop articles scripts systems content more permissions input good practical at the same time passwords tutorials files articles methods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Huawei vpn Linux OPPO Reno