If you are an Ubuntu user looking for the system shutdown and restart commands, follow the guidelines of this article.
Shutdown and restart Ubuntu from the Linux command line
There are several commands to shutdown and restart (reboot) the Ubuntu system and we will discuss them in parts:
1: Shut down Ubuntu from the command line
For Ubuntu users, there are several system shutdown commands which are explained below:
The first command to shut down the Ubuntu system is simply to prompt the user with the “sudo“:
The above command will shut down the Ubuntu system immediately.
The second command is this Just Command that immediately stops/terminates all CPU operations and shuts down the system:
If a user wants to shut down the system after a few minutes, they need to use the following command:
For examplehere I scheduled a shutdown after 1 minute:
The Ubuntu users can also add a specific time for system shutdown with the following command:
For example, here I have scheduled a shutdown at 11:00 am:
To cancel the scheduled shutdown or restart at any time, run the shutdown command with -C to cancel:
2: Restart Ubuntu from the command line
The Ubuntu users can reboot the Ubuntu system using any of the commands described below:
If you want to restart the Ubuntu system immediately, run the below mentioned “reboot” Command:
It may ask for the user password, once you enter the password, the system will reboot:
You can also use the simple reboot command mentioned below, which will reboot the system:
You can also use the “switch off” command with “-R” flag to inform the system to restart after a shutdown:
You can also specify a time for the above giving “switch off” command with “-R” flag to restart the system.
For example, here I scheduled a system reboot at 10:44 p.m. Remember to follow the 24-hour format:
Another Linux command to restart the system is the systemctl reboot command that can be used to reboot the system:
The Ubuntu users can easily shut down the system from the command line with various shutdown commands. These commands shut down the system immediately or perform the shutdown after a specified time. In addition, the users can also use the restart commands or shutdown commands with “-R” flag to restart the system immediately or after some time.