iTranslated by AI
Understanding Linux Runlevels
In this article, I would like to take some notes on something called "runmode" in Linux.
What is runmode?
Runmode is used when you want to use Linux in a CUI (Command Line Interface), even though most people might typically use it with a GUI.
As the name "mode" suggests, there are several modes available.
| Mode | Name | Description |
|---|---|---|
| 0 | Shutdown | Power off |
| 1 | Single User Mode | Assumes only one user; always an administrator |
| 2 | Multi-user Mode (no net) | Apparently not usually distinguished from 3. |
| 3 | Multi-user Mode (with net) | The usual setup where sudo is required for operations needing admin privileges. |
| 4 | Reserved | This is a reserved slot. (I accidentally typed "Yuyaku") |
| 5 | GUI | The usual GUI Linux. |
| 6 | Reboot | This is for rebooting. |
Use Cases
For example, you can turn a laptop you use every day into a temporary server, or you could install a GUI-based OS because you might use the GUI once in a while, but primarily operate it in CUI mode.
Actual Change Methods
Manjaro Linux
sudo systemctl isolate graphical.target # Switch to GUI.
sudo systemctl isolate multi-user.target # Switch to CUI.
It's something like this. Please note that when you switch to CUI, the command line will not appear unless you press Ctrl + Alt + F2.
Ubuntu
In Ubuntu, it seems the only way is to change the default using systemctl set-default.
You can get the current default with systemctl get-default.
When changing it, please enter something like the multi-user.target mentioned above.
Conclusion
Have a great Linux life...
Discussion