“Shutdown” refers to the process of stopping and shutting down a computer or server. This involves cutting the power to the main com­pon­ents of the system using a con­trolled process. Ap­plic­a­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].

Cheap domain names – buy yours now
  • Free website pro­tec­tion with SSL Wildcard included
  • Free private re­gis­tra­tion for greater privacy
  • Free Domain Connect for easy DNS setup

The essential Linux shutdown commands

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

shutdown [OPTION] [TIME] [MESSAGE]

There is at least one al­tern­at­ive 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­pli­citly 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 re­start­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­ately

shutdown -h 0

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

shutdown now

Command for re­start­ing Linux im­me­di­ately

shutdown -r 0

Linux will im­me­di­ately be restarted. In this case, the shutdown command is followed by the “-r” option and the time spe­cific­a­tion “0” which means im­me­di­ately. The following is a fre­quently used command for re­start­ing Linux im­me­di­ately:

shutdown -r now

The standard Linux shutdown command with the one-minute time delay is es­pe­cially 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­trat­or 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­ately shutting down or im­me­di­ately re­start­ing Linux are usually just as simple.

Tip

You can only use shutdown commands on Linux if you have the necessary ad­min­is­trat­or 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”).

Schedul­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­res­pond­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 re­start­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 spe­cific­a­tion is based on the 24-hour format in Linux in ac­cord­ance 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 re­start­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­ously mentioned Linux shutdown commands, there are a number of other commands and options for stopping, shutting down, and re­start­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 pro­cessors (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­pli­citly 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­form­a­tion that is displayed on the screen of the operating system users. For example, an ad­min­is­trat­or can use a wall message to inform users that the system is being shut down.

Command for can­cel­ling 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­tern­at­ive to entering Linux shutdown commands directly, you can install a graphical user interface using software, such as the program shutdown which is es­pe­cially suited to the Linux dis­tri­bu­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