Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to start and enter the Linux command line

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "how to start and enter the Linux command line". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

There may be times when you need or want to start Linux without using GUI (graphical user interface), that is, instead of X, choose the command line. Whatever the reason, fortunately, it's easy to boot directly into the Linux command line. It requires simple changes to boot parameters after other kernel options. This change boots the system to the specified run level.

Why would you do that?

If your system cannot run Xorg due to invalid configuration or damaged display manager or anything that may prevent GUI from starting properly, booting to the command line will allow you to troubleshoot by logging in to the terminal (assuming you know what to do) and do whatever you need to do. Booting to the command line is also a good way to familiarize yourself with the terminal, otherwise, you can do it for fun.

Access the GRUB menu

At startup, you need to access the GRUB startup menu. If the menu is not set to display each time you start your computer, you may need to hold down the SHIFT key before the system starts. In the menu, you need to select the Linux distribution entry. When the entry is highlighted, press e to edit the boot parameters.

Zorin os grub menu

Older versions of GRUB follow a similar mechanism. The startup manager should provide instructions on how to edit startup parameters.

Specify run level

An editor will appear and you will see the option that GRUB parses to the kernel. Move to the line that starts with linux (the old version of GRUB may be kernel, select it and follow the instructions). This specifies the parameters to be resolved to the kernel. At the end of the line (which may span multiple lines, depending on your terminal resolution), just specify the run level to boot, that is, 3 (multi-user mode, plain text).

Customize grub menu

Pressing Ctrl-X or F10 will start the system with these parameters. Turn on the computer as before. * what is changed is the runlevel of the startup.

This is the page after launch:

Boot linux in command line

Operation level

You can specify different run levels, and the default run level is 5 (multi-user graphical interface). 1 Boot to "single user" mode, it will boot into root shell. 3 provides a multi-user command line system.

Switch from the command line

At some point, you may want to run display Manager to use GUI again, and the quickest way is to run this:

This is the end of $sudo init 5, "how to start and enter the Linux Command Line". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report