Shut down and restart Ubuntu from the Linux command line

Ubuntu is a Linux-based distribution that often works through a command-line terminal. Therefore, learning some common commands will be helpful for beginners. Among these commands, some are useful for installing applications while others are useful for working with different directories. There are also some system-related commands that users can use to shut down or restart the system from the command line terminal.

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:

command 1

The first command to shut down the Ubuntu system is simply to prompt the user with the “sudo“:

sudo switch off

The above command will shut down the Ubuntu system immediately.

command 2

The second command is this Just Command that immediately stops/terminates all CPU operations and shuts down the system:

sudo Just

command 3

If a user wants to shut down the system after a few minutes, they need to use the following command:

sudo shutdown +[Time in Minutes]

For examplehere I scheduled a shutdown after 1 minute:

sudo shutdown +1

command 4

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

sudo Shutdown HH:MM

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

sudo switch off 11:00

To cancel the scheduled shutdown or restart at any time, run the shutdown command with -C to cancel:

switch off -C

2: Restart Ubuntu from the command line

The Ubuntu users can reboot the Ubuntu system using any of the commands described below:

command 1

If you want to restart the Ubuntu system immediately, run the below mentioned “reboot” Command:

sudo restart now

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

command 2

You can also use the simple reboot command mentioned below, which will reboot the system:

sudo reboot

command 3

You can also use the “switch off” command with “-R” flag to inform the system to restart after a shutdown:

sudo switch off -R

command 4

You can also specify a time for the above giving “switch off” command with “-R” flag to restart the system.

sudo switch off -R [Hour:Minutes]

For example, here I scheduled a system reboot at 10:44 p.m. Remember to follow the 24-hour format:

sudo switch off -R 22:44

command 5

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

sudo Systemctl restart

Diploma

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.

Related Posts