Ways to Reboot Ubuntu Through the Command Line

Looking for ways to reboot Ubuntu through the Command-Line? We got you covered!

What differentiates Linux distributions from its rival operating systems is the functionality of its Command-Line Input.

All processes with a long and complicated GUI-based method can be completed by typing their corresponding commands in the Command Terminal. Aside from that, there are multiple commands that – when paired with the right options, can perform a single task. The difference is usually in their approach to it.

An example of such a task is rebooting your system. While Linux distributions tend to be stable for the most part, they may require a system restart to handle a crash.

Whether it’s installing an important application that requires a system restart or just resetting your system in general, knowing how to reboot your system directly through the Command Terminal can save you lots of time in the long run.

This guide will cover ways to reboot Ubuntu through the Command-Line Input. We’ll go over the different commands that you can use to reboot your system, their syntax, and when to use them.

That being said, let’s take a look at the methods!


Prerequisites for Rebooting Your System Using the Terminal.

While the ways to reboot Ubuntu through the Command-Line consist of simple and easy-to-understand commands, certain conditions must be met to ensure that you don’t encounter any errors.

First and foremost, ensure that you have an account with sudo or root privileges. This will save you from errors related to administrator restrictions.

Furthermore, it should be noted that we’ll be using Ubuntu 20.04 LTS for this guide. However, the methods shouldn’t differ for previous versions of Ubuntu as well.

Now that you’re aware of the prerequisites, let’s take a look at the methods.


Method 1: Reboot Ubuntu Using the $reboot Command.

This is the most common method that is used to reboot your system. Normally, whenever you’re asked to reboot your system, this is the go-to command.

The syntax of the command is:

$ reboot <options>

Using the command without any options will restart your system after all processes shut down. Reboot works by shutting your system down and then starting it again. While this information may seem to be redundant, it is necessary to distinguish reboot from the following.

$ reboot --f

The --f option directly proceeds to reboot your system without waiting for the processes to shut down.

Follow these steps to restart your system using the $reboot command:

  1. Start by opening the Command Terminal. The shortcut is Ctrl + Alt + T.
  2. Once the Terminal is open, type in the following command:
$ sudo reboot <options>

In our case,

$ sudo reboot  
reboot ubuntu through command line

The Terminal will ask for your password. Simply type it and press Enter.

If you correctly followed these steps, you should have successfully rebooted your system.

ubuntu loading

If you’re experiencing any errors when trying to use this command, then worry not, we still have other methods for you.


Method 2: Reboot Ubuntu Using the $shutdown Command.

If the previous method didn’t work out for you, you can try to use the $shutdown command.

The $ shutdown command, as the name suggests, is used to shut down your system. However, you can use it to restart your system by providing it with the right flags and options.

The syntax for the shutdown command is as follow:

$ shutdown <options>

To reboot the system, you can make use of the -r option.

Follow these steps to reboot Ubuntu using the $shutdown command:

  1. First, open the Command Terminal by pressing Ctrl + Alt + T on your keyboard.
  2. Next, type the following command:
$ sudo shutdown -r now
reboot ubuntu through command line

The Terminal will request for your password. Simply type it and press Enter.

If you did the steps correctly, you should have successfully rebooted your system. 

The shutdown command can also trigger a delayed system restart.

Follow these steps to trigger a delayed reboot using the shutdown command:

  1. Start by opening the Command Terminal. The shortcut is Ctrl + Alt + T.
  2. Now that the Terminal is open, type the following command:
$ sudo shutdown -r <time in hr:mm>

In our case,

$ sudo shutdown 2
sudo shutdown

This will trigger a reboot after 2 hours. You can also specify the delay time in minutes by using the +m option.

If the shutdown command didn’t seem to do the trick, you can try out the next method.


Method 3: Reboot Ubuntu Using the $init Command.

If the previous method didn’t work out for you, you can try to use the $init command.

The $init command stops all processes that are running and proceeds to synchronize the disc according to their priority levels.

Follow these steps to reboot Ubuntu using the $init command:

  1. First, open the Command Terminal by pressing Ctrl + Alt + T on your keyboard.
  2. Next, type the following command:
$ sudo init -6
reboot ubuntu through command line

The Terminal will prompt you to enter your password. Simply type it and press Enter.

With the steps followed correctly, you should have successfully started your system.


Method 4: Reboot Ubuntu Using the $systemctl Command.

You can also restart your system with the help of the $systemctl command.

The $systemctl command has the following syntax for rebooting a system:

$ systemctl reboot

Follow these steps to reboot your system using $systemctl:

  1. Start by opening the Command Terminal by pressing Ctrl + Alt + T on your keyboard
  2. Once the Terminal is open, type out the following command:
$ sudo systemctl reboot
reboot ubuntu through command line

If you followed the steps correctly, you should’ve successfully rebooted your system.

While restarting your system can deal with the problem of an unresponsive application, oftentimes, you can get away with killing and restarting the unresponsive process.

Learning how to kill a process on Linux can save you from the trouble of dealing with unresponsive applications. Additionally, it can also free up your computer resources, allowing your PC to run faster.

This concludes our guide on ways to reboot Ubuntu through the Command-Line. We went over the prerequisites for rebooting your system using the CLI and discussed different methods to do so. If you have any questions, comments, or suggestions, let us know in the comment section down below.

If this guide helped you, please share it. 🙂

Author

Leave a Reply

Your email address will not be published. Required fields are marked *