How to enter the command line after the Linux system GUI starts

  
                

After the Linux system is started, enter the GUI login environment. If you want to enter the command line directly, you need to make certain settings. You can set the temporary access command line or enter the command line permanently. The following small series will introduce the big sister. The method of entering the command line after the Linux system GUI starts.

The Linux desktop comes with a display manager (eg GDM, KDM, LightDM) that allows the computer to launch automatically into a GUI-based login environment. However, what if you want to boot directly into the terminal? For example, you are troubleshooting desktop-related issues or want to run an application that does not require a GUI.

Note that although you can temporarily switch from the desktop GUI to the virtual terminal by pressing Ctrl+Alt+F1 to F6. However, in this case your desktop GUI is still running in the background, which is different from plain text mode startup.

You can start text mode at startup by passing the appropriate kernel parameters.

First, start the temporary entry command line

If you want to disable the desktop GUI and temporarily enter the text mode, you can use the GRUB menu.

First, turn on your computer. When you see the initial GRUB menu, press ‘e’.

will then go to the next screen, where you can modify the kernel boot option. Scroll down to the line starting with “linux” here is a list of kernel parameters. Delete “quiet” and “splash” in the parameter list. Add “text” to the parameter list.

upgrade the kernel options list looks like this. Press Ctrl+x to continue. This will start the console once in verbose mode (LCTT translation: since there is no save modification, the next reboot will also enter the GUI).

Second, the permanent boot into a command line

If you want to permanently boot into the command line, you need to update the definition of the kernel boot parameters GRUB setting.

Open the default GRUB configuration file in a text editor.

$ sudo vi /etc/default/grub

Find the line starting with GRUB_CMDLINE_LINUX_DEFAULT and comment this line with “#”. This disables the initial screen and starts the verbose mode (that is, shows the detailed startup process).

Change GRUBCMDLINELINUX=“” into:

GRUB_CMDLINE_LINUX=“text”

Next, uncomment the “#GRUB_TERMINAL=console”

The updated GRUB configuration looks like this.

Finally, regenerate the GRUB2 configuration files in /boot using the update-grub command based on these changes.

$ sudo update-grub

At this point, your desktop should be able to switch from GUI startup to console startup. Can be verified by reboot.

Linux boot method above is introduced into the command line, a total paper describes two types of entry method, if you need to set the permanent boot into the command line, you can use the second method.

Copyright © Windows knowledge All Rights Reserved