Reboot Ubuntu Linux

When you use your computer system, sometimes it gets stuck, or you have installed new software, then you need to restart your system to make it work properly. There are many ways you can manually restart your PC. In Linux, you can also give your PC commands through the terminal to restart it. So, in this article, we will explain to you the different methods you can use to restart Ubuntu via the command line.

Restart or Reboot Ubuntu via the command line

To restart Ubuntu 22.04 or Ubuntu 20.04 from the command line, you can use one of the three methods described below.

The reboot command

To reboot your Ubuntu with the reboot command, you need to follow the steps below:

First, you need to start the terminal in Ubuntu To do this, press Ctrl+T or click on the Activities icon on your desktop, type terminal in the search bar that appears, and double-click on the search result to launch the terminal. You can also right-click on your desktop and then select Open Terminal from the menu that pops up. The newly launched terminal window can be seen in the following figure:

command prompt

Now type the following command in your terminal and then press the Enter key:

sudo reboot

This command is also shown in the following image:

reboot Ubuntu

As soon as this command executes successfully, your PC will immediately be rebooted.

The shutdown command

To reboot your Ubuntu with the shutdown command, you need to follow the steps below:

First, you need to launch the terminal in Ubuntu. To do this, you can press Ctrl+ T or click the Activities icon on your desktop and then type terminal in the search bar that appears. You can also right-click on your desktop and then select Open Terminal from the menu that pops up. The newly launched terminal window can be seen in the following figure:

Open a command prompt

Although the shutdown command is primarily used to turn off your PC, it can also be used in conjunction with the -r flag to restart your PC. To do this, type the following command into your terminal and then press Enter:

sudo shutdown -r

This command is also shown in the following image:

shutdown -r command

Once this command is successfully executed, your PC will reboot immediately. However, if you want your PC to reboot after a few minutes, type the following command into your terminal and then press Enter:

sudo shutdown -r +mins

Here, replace mins with the number of minutes after which you want your PC to reboot. To illustrate, we tried to restart our PC after 30 minutes, so we replaced mins with 30, as shown in the figure below:

Reboot Ubuntu in 30 minutes

If you want your PC to restart at a certain time of the day, you need to type the following command into your terminal and then press Enter:

sudo shutdown –r hh: mm

Here, replace hh with the hour and mm with the minutes, i.e. the exact time at which the reboot should be scheduled. For example, we have replaced hh: mm with 08:00, which means that our PC will be restarted at 8 am, as shown in the following figure:

Rebbot PC at specific time

The init command

To reboot your Ubuntu with the init command, you need to follow the steps below:

First, you need to start the terminal in Ubuntu. To do this, you can press Ctrl+T or click the Activities icon on your desktop and then type terminal in the search bar that appears. You can also right-click on your desktop and then select Open Terminal from the menu that pops up. The newly launched terminal window can be seen in the following figure:

The Ubuntu terminal console

Now type the following command in your terminal and then press the Enter key:

init 6

The combination of the init command with the number 6 is specifically used for rebooting your PC. This command is also shown in the following image:

Reboot Ubuntu using init command

As soon as this command executes successfully, your PC will immediately be rebooted.

How to Reboot Ubuntu Using Command-Line