How to Restart Ubuntu From the Terminal

The most basic tasks of an operating system such as shutting it down or restarting it can also be done from a terminal in Linux. This gives us versatility so that in various configuration scripts we have more control over the system. Today, you will learn how to restart Ubuntu from the terminal.

Is it useful to restart Ubuntu from the terminal?

The answer to this question is more focused on using Ubuntu as a server than as a workstation. Because it is true that using a desktop environment, tasks such as shutting down or rebooting the system can be done with a few clicks. But in the case of servers where there is no graphical interface, then it is useful to know this.

Besides this, learning how to do it also gives us versatility when working with Script or command executions, for example in the case of Docker.

So as you can see, although the process is simple and for many irrelevant, it can be very useful in other more professional environments.

Reboot Ubuntu from the terminal

To achieve our goal, we have several commands that in practice do the same thing. However, I’ll leave them for you to take notes and make your choice.

Method 1: Restart Ubuntu with the shutdown command

The shutdown command is used on Linux to shut down the computer. However, we can, thanks to the -r option to reboot Ubuntu.

sudo shutdown -r

This will automatically reboot the system.

One of the advantages of this command is that you can specify a restart time. For example,

sudo shutdown -r 30

This will cause the system to reboot 30 minutes after the program has run.

Or even specify the time that the system will reboot at

sudo shutdown -r 22:15

That is, it will reboot Ubuntu at 22:15.

As you can see, the shutdown command gives us some flexibility when choosing the time to reboot the system.

Method 2: Using the reboot command

If you want to use another command, we have the reboot command. This command, as you read it, reboots the system immediately.

sudo reboot

As you can see, it is easy to use and ideal for beginners.

Conclusion

Rebooting Ubuntu using the terminal is a simple process thanks to the shutdown and reboot commands that allow us to do the task. These commands are useful in configuration scripts and especially in image automation process.

I hope you liked our post and help us to share it.

Leave a Comment

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

Scroll to Top