How To Boot Into Linux Command Line

There may be times where you need or want to boot up a Linux system without using a GUI, that is with no X, but rather opt for the command line. Whatever the reason, fortunately, booting straight into the Linux command-line is very simple. It requires a simple change to the boot parameter after the other kernel options. This change specifies the runlevel to boot the system into.

​Why Do This?

If your system does not run Xorg because the configuration is invalid, or if the display manager is broken, or whatever may prevent the GUI from starting properly, booting into the command-line will allow you to troubleshoot by logging into a terminal (assuming you know what you’re doing to start with) and do whatever you need to do. Booting into the command-line is also a great way to become more familiar with the terminal, otherwise, you can do it just for fun.  

​Accessing GRUB Menu

On startup, you will need access to the GRUB boot menu. You may need to hold the SHIFT key down before the system boots if the menu isn’t set to display every time the computer is started. In the menu, the Linux distribution entry must be selected. Once highlighted, press ‘e’ to edit the boot parameters.

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

​​Specify the Runlevel

​An editor will appear and you will see the options that GRUB parses to the kernel. Navigate to the line that starts with ‘linux’ (older GRUB versions may be ‘kernel’; select that and follow the instructions). This specifies parameters to parse into the kernel. At the end of that line (may appear to span multiple lines, depending on resolution), you simply specify the runlevel to boot into, which is 3 (multi-user mode, text-only).

Pressing Ctrl-X or F10 will boot the system using those parameters. Boot-up will continue as normal. The only thing that has changed is the runlevel to boot into.

This is what was started up:


You can specify different runlevels to boot into with runlevel 5 being the default one. 1 boots into “single-user” mode, which boots into a root shell. 3 provides a multi-user, command-line only system.  

Switch From Command-Line

At some point, you may want to run the display manager again to use a GUI, and the quickest way to do that is running this: $ sudo init 5 And it is as simple as that. Personally, I find the command-line much more exciting and hands-on than using GUI tools; however, that’s just my preference.