Ubuntu

Shutdown and Restart Ubuntu using Linux Command Line

Ubuntu is a Linux-based distribution that often operates through a command-line terminal. Thus, learning some widely used commands is helpful for beginners. Among these commands, some are useful for installing applications, while others are beneficial for working with different directories. There are some system-related commands too that allow users to shut down or restart the system through the command-line terminal.

As an Ubuntu user, if you are searching for the commands to shut down and restart the system, follow this article’s guidelines.

Shutdown and Restart Ubuntu Using Linux Command Line

There are multiple commands to shutdown and restart (reboot) the Ubuntu system, and we will discuss them in parts:

1: Shutdown Ubuntu Using Command Line

For Ubuntu users, there are multiple commands to shutdown the system, which are discussed below:

Command 1
The first command to shutdown the Ubuntu system is straightforward that users have to execute using the “sudo”:

sudo shutdown

The above command will immediately shutdown the Ubuntu system.

Command 2
The second command is the halt command that immediately stop/cease all CPU operations and shut down the system:

sudo halt

Command 3
If a user wants to shutdown the system after some minutes, he/she have to use the following command:

sudo shutdown +[Time in Minutes]

For example, here I have scheduled a shutdown after 1 minute:

sudo shutdown +1

Command 4
The Ubuntu users can also add a specific time for system shutdown using the following command:

sudo shutdown HH:MM

For instance, here I have scheduled a shutdown at 11:00 am:

sudo shutdown 11:00

To cancel the scheduled shutdown or reboot at any time, run the shutdown command with -c for cancel:

shutdown -c

2: Restart the Ubuntu Using Command Line

The Ubuntu users can restart the Ubuntu system through any of the command discussed below:

Command 1
If you want to immediately restart the Ubuntu system then run the below-mentioned “reboot” command:

sudo reboot now

It may ask for the user password, as soon as you will enter the password, the system will reboot:

Command 2
You can also use the simple reboot command which is mentioned below that will restart the system:

sudo reboot

Command 3
You can also use the “shutdown” command with “-r” flag to inform the system to restart after a shutdown:

sudo shutdown -r

Command 4
You can also specify a time for the above give “shutdown” command with “-r” flag to restart the system.

sudo shutdown -r [Hour:Minutes]

For example, here I have scheduled a system reboot at 10:44 pm. Just remember to follow the 24-hour format:

sudo shutdown -r 22:44

Command 5
Another Linux command to restart the system is the systemctl reboot command that can be used to restart the system:

sudo systemctl reboot

Conclusion

The Ubuntu users can easily shutdown the system from the command-line using different shutdown commands. These commands immediately shut down the system or perform shutdown after a specific time. Further, the users can also use the reboot commands or shutdown commands with “-r” flag to restart the system immediately or after some time.

About the author

Zahra Zamir

An Electronics graduate who loves to learn and share the knowledge, my passion for my field has helped me grasp complex electronics concepts and now I am here to share them with others.