Boot linux command line

Ubuntu 14.04, 13.10: Boot into Text Mode / Console / Command Line

This simple tutorial will show you how to boot your Ubuntu system directly into command line (text mode or console). If you just want a console for temporary use, press Ctrl+Alt+F1 on keyboard will switch your desktop to tty1.

Update: Thanks to August Karlstrom, before getting started, make a backup by running the command below:

sudo cp -n /etc/default/grub /etc/default/grub.orig

If for some reason you want to revert to original settings, just run command below in terminal:

sudo mv /etc/default/grub.orig /etc/default/grub && sudo update-grub

To get started, press Ctrl+Alt+T to open terminal. When it opens, follow the below steps:

1. Copy and paste below command into terminal and hit enter:

sudo gedit /etc/default/grub

This opens Grub boot loader config file with text editor.

  • Comment the line GRUB_CMDLINE_LINUX_DEFAULT=”quiet splash”, by adding # at the beginning, which will disable the Ubuntu purple screen.
  • Change GRUB_CMDLINE_LINUX=”” to GRUB_CMDLINE_LINUX=”text”, this makes Ubuntu boot directly into Text Mode.
  • Uncomment this line #GRUB_TERMINAL=console, by removing the # at the beginning, this makes Grub Menu into real black & white Text Mode (without background image)

Ubuntu boot into text mode

3. After saved the changes, update grub via command:

Restart your computer and see the result.

permalink

Ji m

I’m a freelance blogger who started using Ubuntu in 2007 and wishes to share my experiences and some useful tips with Ubuntu beginners and lovers. Please comment to remind me outdated tutorial! And, notify me if you find any typo/grammar/language mistakes. English is not my native language. Contact me via [email protected] Buy me a coffee: https://ko-fi.com/ubuntuhandbook1

28 responses to Ubuntu 14.04, 13.10: Boot into Text Mode / Console / Command Line

I always make a backup of any system wide configuration file before editing it, in this case: cp -n /etc/default/grub /etc/default/grub.orig. It is very useful to be able to restore the original file in case something goes wrong. It is also nice to be able to get a list of all edited files with `locate *.orig`.

sorry:
message: /usr/sbin/grub-probe: error failed to get canonical path of ‘/cow’.
cow is correct 🙂

Thanks it works (on lubuntu) ! ^^
But after when I want to launch the GUI doing startx, it doesn’t work…
Any Ideas ?

How the do I get back to being able to use the GUI. all sorts of problems trying to get back to the way it was.

i had the same problem in ubuntu 14.04. I tried all the ttys and finally reached the gui in tty7
i did ctrl + alt + f7
try the function (F) keys in succession

Unfortunately, it didn’t work in my circumstance. My operation system is Ubuntu 15.04 in Virtualbox. Even though I have modified the grub file and update grub, it constantly boots into the desktop mode. Anyone can help me on it?

Читайте также:  Ia32 libs arch linux

I found a solution booting up Ubuntu 15.04 into console mode.
As suggested here: After you fixed the grub file and run update-grub execute:
sudo systemctl set-default multi-user.target

Thanks for this. I made some slight changes to my bashrc so I could easily toggle between command line interface and GUI, as service lightdm start didn’t work for me. This may help someone else.
alias console=’sudo cp /etc/default/grub.console /etc/default/grub && sudo update-grub && sudo reboot’ alias gui=’sudo cp /etc/default/grub.gui /etc/default/grub && sudo update-grub && sudo reboot’
This is dependent of course on having saved the modified grub file as grub.console and the original as grub.ui. Now we can now toggle between console and ui mode simply by entering gui or console at a terminal!

Nice inspiration. Thank you. I wrote a small tool for that which works fine with Lubuntu (Ubuntu 15.10). Feel free to use or modify it. https://github.com/NazimKenan/smallShelly/blob/master/qweConsole You can easily switch between boot either to console or to gui.

THis only partly works. It doesn’t boot into the gui, but I don’t end up with an interactive shell in the console either. No response to newline, no prompt.

I have upgraded ubuntu 12.04 and now when i start ubuntu it only shows the command line screen. How cani will get to GUI.

I am doing my research in big data analytics. After upgrade my ubuntu i got some errors like “hadoop is not in sudoers file”. Can anyone help me to solve this error.

These instructions did not work for me in ubuntu 16. Instead, it was necessary to make these changes which I found on another website. GRUB_CMDLINE_LINUX_DEFAULT=”quiet” (instead of simply commenting out this line) GRUB_CMDLINE_LINUX=”3″ (“3” instead of “text” as advised here) GRUB_TERMINAL=console (line uncommented exactly as advised here) The key thing is the “3” which causes it to stick with the terminal through phase 3 or something like that.

I am running Firefox 115.0.2 (64-bit) on Ubuntu 23.04. I’m getting the «Native messaging portal is not available» message, starting…

It didn’t work on Zorin 16.02 I am using a custom shell theme, but that shouln’t cause any problem. But…

No, you don’t need to switch to DEB version. Run the command below in terminal: flatpak make-current —user org.gimp.GIMP beta…

Источник

Force boot into Linux command line [closed]

I am trying a number of settings on my Ubuntu 11.10 box. Unfortunately, I messed up some settings and the X window does not boot up. I need to boot into command line to restore some settings. However, everytime I boot, the system hangs at the Ubuntu welcome screen. All I can do is to reboot the machine. Is there anyway I can boot into the command line directly? Many thanks

3 Answers 3

To switch back and forth from X to CLI is by using the virtual terminals. You can boot into X and then hit Ctrl+Alt+ where Fn is a function key from F2 to F6 . To return to X is with Ctrl+Alt+F7

Читайте также:  Virtual ips on linux

Normally the grub boot loader offers you to boot in recovery mode

Even if the GUI console is messed up, you can probably to get to text mode) virtual console 1. Similarly, bring you to text-mode virtual consoles 2, 3, 4, . You can log on to any of them — or any combination of them:

PS: To boot into text-only mode (instead of the GUI), you can do this (provided, of course, you can log on!):

http://ubuntuforums.org/showthread.php?t=1480813 in /etc/init/rc-sysinit.conf: env DEFAULT_RUNLEVEL=3 in /etc/init/gdm.conf: start on (filesystem and started hal and tty-device-added KERNEL=tty7 and (graphics-device-added or stopped udevtrigger) and runlevel [!3]) stop on runlevel [016] tech78i is offline 

PPS: On most other Linux variants, you’d set «default runlevel 3» by editing /etc/inittab.

Источник

How to boot, shut down, and suspend your system from the Linux command line

Learn how to schedule timed shutdowns and reboots with systemd and to hibernate your system with systemctl.

Sysadmin working on three monitors in dark room

Let’s face it: The most fundamental thing we do with computers is turn them on and off. Everything else happens between those two particular events. And sometimes, restarting the system is a key component of troubleshooting or completing installation processes.

Training & certification

Typically, you need root privileges to shut down or reboot the system. Ensure your account is configured in /etc/sudoers for this authority. Remember, it’s generally a bad idea to log on directly as root.

Boot the system

Starting the system is as simple as pressing the power button. What happens from there varies a bit depending on your hardware, but in general, the process looks like this:

  1. The firmware (BIOS or UEFI) finds the boot media.
  2. The boot loader starts, and the Master Boot Record (MBR) or GUID Partition Table (GPT) loads.
  3. The operating system selection menu appears.
  4. The boot loader stage 2 starts and loads the selected kernel.
  5. The kernel and drivers load and mount the root filesystem.
  6. systemd launches as PID 1.
  7. The default.target file loads.
  8. The user is prompted to authenticate.

The system launches to the default.target (providing either a command-line interface or graphical environment). Changing these targets is outside the scope of this article but is something I cover in How to switch between the CLI and GUI on a Linux server.

Shut down the system

When Red Hat Enterprise Linux (RHEL) adopted systemd with RHEL 7, what happened to the venerable Linux shutdown command? It remains—but now it maps to systemd’s shutdown functions.

The shutdown command features two options: —halt and —poweroff . The —halt option stops the operating system while the —poweroff option turns off the system.

One of the main benefits of the shutdown command is the ability to define a shutdown delay to give users time to save their work and log off the system. Schedule a time that suits your needs by using the format hh:mm (24-hour time designations).

For example, to halt the system at 10pm, type:

It’s more likely that you’ll want to halt the operating system a few minutes into the future. In that case, specify the number of minutes from now to begin the shutdown process.

Читайте также:  Wf m5799 linux driver

For example, to halt the system after a five-minute delay, type:

You can append a message to all users by entering it after the time specification, like this:

$ sudo shutdown --halt +5 “Attention. The system is going down in five minutes.”

Cancel a timed shutdown by using the -c option:

IT Automation ebook

You can also use the systemctl command to shut down the system. For example, type systemctl halt or systemctl poweroff to achieve similar results to the shutdown command. The main disadvantage of using systemctl is losing the ability to schedule or cancel the shutdown process.

Reboot the system

When someone approaches you for help with their computer, I suspect one of your first responses is, «Did you reboot it?» Restarting a computer helps with various problems and may even be necessary to finalize some configurations. However, restarting is considered downtime on a server and should be avoided if possible. Try to use systemctl restart to restart services rather than reboot the whole system.

However, sometimes a restart is inevitable. The option for restarting the system immediately with the shutdown command is -r , so it looks like this:

You can still specify a delayed time using the hh:mm format explained above.

You can also use systemctl to reboot the device by typing:

Again, the disadvantage with systemctl is the inability to delay the process.

Suspend the system

Great Linux resources

There are a couple of ways to place the system in a reduced or no-power mode. The first is suspend and the second is hibernate.

When you suspend the system:

  • Contents of memory are moved to the swap location.
  • The boot loader is configured to boot directly to the current kernel.
  • The system shuts down (no-power mode).
  • Upon power up, the system reloads itself from swap.

When you hibernate the system:

  • Applications are stopped.
  • System state is moved to RAM.
  • The system remains powered on in a low-power state.

You can also suspend and hibernate the system by using the systemctl command. The commands are exactly what you’d expect:

$ sudo systemctl suspend $ sudo systemctl hibernate $ sudo systemctl hybrid-sleep

The systemctl hybrid-sleep command both suspends and hibernates the system.

Use the GUI

Depending on the graphical user interface (GUI) environment you have installed, you can initiate a reboot or shutdown from a menu. Many people rely on a graphical desktop like GNOME, so this is certainly a viable option.

Power off and log out options in GNOME

[ Because sudo is something you don’t configure often, it can be hard to remember its nuances. Download the Linux sudo cheat sheet. ]

Wrap up

The familiar shutdown command now maps to systemd and executes timed shutdowns and reboots. You can use systemctl if you wish, but being able to schedule the shutdown is helpful. In addition, systemctl also offers suspend and hibernate options. Try to avoid bringing down the system when possible, but sometimes it’s necessary.

Источник

Оцените статью
Adblock
detector