When using your computer, it may sometimes freeze or require a restart after installing new software to function correctly. There are several ways to restart your PC manually, and in Linux, you can also use terminal commands. This article will explore different methods of restarting Ubuntu using the command line.
Restart or Reboot Ubuntu via the Command Line
You can use one of the three methods outlined below to restart Ubuntu 24.04 or Ubuntu 22.04 from the command line.
Using the reboot Command
To reboot your Ubuntu system using the `reboot` command, follow these steps:
Open the terminal in Ubuntu. You can do this by pressing Ctrl+T or by clicking the Activities icon on your desktop, typing terminal in the search bar, and double-clicking the search result to launch the terminal. Alternatively, you can right-click on your desktop and select Open Terminal from the context menu.
Once the terminal is open, you can proceed with the reboot command as shown in the following example.

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:
![]()
Your PC will immediately be rebooted as soon as this command executes successfully.
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:

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:
![]()
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:
![]()
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:
![]()
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:

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:
![]()
As soon as this command executes successfully, your PC will immediately be rebooted.