How To Restart Ubuntu Using The Terminal

Restart Ubuntu Using The Terminal

Understanding how to restart Ubuntu is an important skill for those using this operating system. There are times when restarting Ubuntu is necessary for it to work correctly.

For example, if you change the system’s swap size, you need to restart your computer to make these changes work. Also, after updating the kernel, which is a core part of the operating system, you need to restart to start using the new version.

In the next parts of this guide, we will look at three different ways to restart your Ubuntu system easily. If you are using Ubuntu on a desktop computer, you can use these methods through the terminal, which you can open by pressing CTRL + ALT + T.

Restarting Ubuntu using the Reboot Command

The simplest way to restart Ubuntu within the terminal is by using the reboot command. This command is very simple to remember and doesn’t require any extra arguments to execute a restart.

As this command is a core part of Linux, it should work on any Linux-based system.

reboot

Since you need super user privileges to restart Ubuntu, you may be required to include “sudo” in front of the command.

sudo reboot

Should your Ubuntu device fail to restart following the execution of the reboot command, there is an option to force a restart. It’s important to note, though, that forcing a reboot carries the risk of data loss, so it should be used with caution.

You can force a restart on Ubuntu by using the following command within the terminal.

sudo reboot --force


You Might Like: 30 Essential Commands For The Raspberry Pi


Using the shutdown Command to Restart Ubuntu

Even though its name is “shutdown”, you can also use this command to restart the Ubuntu operating system. While it isn’t as completely straightforward to use as “reboot”, it is still very simple.

One of the key differences this command has over reboot is that you can schedule when a restart will occur.

The easiest way to utilize this command is to use “shutdown” followed by the “-r” or "--reboot” arguments. When using the command, your device will be rebooted 1 minute from when you ran the command.

sudo shutdown -r

Or, if you wanted to specify how many minutes should pass before your Ubuntu device is restarted, you could use the following.

Just ensure that you replace “MINUTES” with the number of minutes you want to be passed before the reboot occurs.

sudo shutdown -r +MINUTES

As an example, you would use the following command to restart Ubuntu in 30 minutes.

sudo shutdown -r +30

Just like using the reboot command, you can restart Ubuntu immediately by writing “now” in the place where you would specify the time.

sudoshutdown -r now

It is possible to cancel any pending restarts using the “-c” option alongside shutdown.

sudo shutdown -c

How To Restart Ubuntu Using The Terminal

Using systemctl to Restart Ubuntu

Finally, it is also possible to use systemctl to restart your Ubuntu device. You may be familiar with this tool if you are using it to manage services running on Ubuntu.

To restart Ubuntu using systemctl, all you need to do is type the following into the terminal.

sudo systemctl reboot

When using this command, the restart will occur immediately. There will be no delay.


You Might Like: What Is The Steam Deck?


Final Thoughts

This article has provided a detailed guide on how to restart your Ubuntu system using terminal commands. While the process is generally straightforward, it’s important to approach it with an understanding of the potential risks, such as data loss when forcing a reboot.

These commands are invaluable tools for managing and maintaining the health and performance of your Ubuntu system, ensuring that updates and changes are effectively applied.

Whether you’re a seasoned Ubuntu user or new to the operating system, mastering these restart techniques is essential for efficient system management.

Erik D

Leave a Comment

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