“Shutdown” refers to the process of stopping and shutting down a computer or server. This involves cutting the power to the main com­po­nents of the system using a con­trolled process. Ap­pli­ca­tions are closed, active processes and protocols are saved to the hard drive, device drivers are removed, and user settings are saved in the process. Linux operating systems can easily be stopped, shut down, and restarted using the shutdown command and its various options. Linux shutdown commands are entered in the Linux terminal that is launched by using the keyboard shortcut [Ctrl] + [Alt] + [T]. You can then close the terminal window with the shortcut [Ctrl] + [D].

$1 Domain Names – Grab your favorite one
  • Simple reg­is­tra­tion
  • Premium TLDs at great prices
  • 24/7 personal con­sul­tant included
  • Free privacy pro­tec­tion for eligible domains

The essential Linux shutdown commands

When shutting down or restart­ing Linux via the terminal, the “shutdown” command is essential. You can add an option to it followed by a time spec­i­fi­ca­tion and a message. The syntax of the Linux shutdown command is as follows:

shutdown [OPTION] [TIME] [MESSAGE]

There is at least one al­ter­na­tive for each command listed here that produces the same result.

Standard command for shutting down Linux

shutdown -h

Linux will shut down in under a minute. The “-h” option ex­plic­it­ly stands for the shutting down or powering off of a system. You can usually produce the same results by just entering the shutdown command on its own.

shutdown

Standard command for restart­ing Linux

shutdown -r

Linux will be restarted in under a minute. The “-r” option stands for reboot or restart.

Command for shutting down Linux im­me­di­ate­ly

shutdown -h 0

Linux will im­me­di­ate­ly be shut down. In this case, the shutdown command is followed by the “-h” option and the time spec­i­fi­ca­tion “0” which means im­me­di­ate­ly. The following is another far more common command for shutting down Linux im­me­di­ate­ly:

shutdown now

Command for restart­ing Linux im­me­di­ate­ly

shutdown -r 0

Linux will im­me­di­ate­ly be restarted. In this case, the shutdown command is followed by the “-r” option and the time spec­i­fi­ca­tion “0” which means im­me­di­ate­ly. The following is a fre­quent­ly used command for restart­ing Linux im­me­di­ate­ly:

shutdown -r now

The standard Linux shutdown command with the one-minute time delay is es­pe­cial­ly useful for multi-user solutions (i.e. when multiple users are accessing a Linux computer or server). In this situation, the network ad­min­is­tra­tor is able to set up a warning message as a wall message to inform users that the system will be shut down or restarted shortly. If Linux is only being used on a single computer, the commands for im­me­di­ate­ly shutting down or im­me­di­ate­ly restart­ing Linux are usually just as simple.

Tip

You can only use shutdown commands on Linux if you have the necessary ad­min­is­tra­tor rights. You can get around this on some Linux systems by simply adding the “sudo” command before the Linux shutdown command in question (e.g. “sudo shutdown now” or “sudo shutdown -r 0”).

Sched­ul­ing Linux shutdowns or restarts

You can also easily schedule Linux shutdowns or restarts to occur after a certain period of time or at a certain time. To do this, you have to add the number of minutes or the time after the cor­re­spond­ing Linux shutdown command, as shown in the examples below:

Command for shutting down Linux after 20 minutes

shutdown -h 20

Linux will shut down 20 minutes after the command is entered. The following command is sometimes more commonly used and produces the same result:

shutdown +20

Command for restart­ing Linux after 20 minutes

shutdown -r 20

Linux will restart 20 minutes after the command is entered. You can also use the plus sign with this command.

shutdown -r +20

Command for shutting down Linux at 5:30 p.m.

shutdown -h 17:30

Time spec­i­fi­ca­tion is based on the 24-hour format in Linux in ac­cor­dance with the syntax (hh:mm). In this example, Linux is shut down at 5:30 p.m. (i.e. 17:30). Once again, you can omit the “-h” option which stands for the shutting down or powering off of a system:

shutdown 17:30

Command for restart­ing Linux at 5:30 p.m.

shutdown -r 17:30

Linux will restart at 5:30 p.m. (i.e. 17:30). In this case, the “-r” option, which stands for “reboot”, obviously cannot be omitted – otherwise, Linux would shut down without rebooting.

Linux shutdown – ad­di­tion­al commands

In addition to the pre­vi­ous­ly mentioned Linux shutdown commands, there are a number of other commands and options for stopping, shutting down, and restart­ing Linux operating systems. These can generally also be combined with commands for scheduled Linux shutdowns.

Note

There is a dif­fer­ence between “stopping a system” and “turning off a system”. When you stop it, all the proces­sors (CPUs) are stopped, but when you turn it off, it is also cut off from the main power supply. Generally, the term “shutdown” is un­der­stood to be the stopping and powering off of a system.

Command for powering off Linux

shutdown -P

This command ex­plic­it­ly indicates that the system will be shut down and the main power supply will be cut off.

Command for setting up a wall message

shutdown 'WRITE YOUR WALL MESSAGE HERE'

A wall message is in­for­ma­tion that is displayed on the screen of the operating system users. For example, an ad­min­is­tra­tor can use a wall message to inform users that the system is being shut down.

Command for canceling scheduled shutdowns or restarts

shutdown -c

Using this command, you can cancel a scheduled shutdown or restart. This requires that the process has not yet started.

Using simple commands in the Linux terminal, you can stop, shut down, and restart your operating system. As an al­ter­na­tive to entering Linux shutdown commands directly, you can install a graphical user interface using software, such as the program shutdown which is es­pe­cial­ly suited to the Linux dis­tri­b­u­tion Ubuntu.

Note

You can find all the essential commands you need to control a Linux operating system via a terminal in our article “An overview of the most important Linux commands”.

Go to Main Menu