Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Use the Linux shutdown Command

Power off, restart or schedule a shutdown, and cancel it.

How-To Guides2 min read2 screenshots

Basic use

Power off now:

sudo shutdown -h now

-h means halt (stop) and, on most systems, power off.

Schedule a shutdown

In 10 minutes:

sudo shutdown -h +10
Scheduling a shutdown in ten minutes

At a specific time (24-hour clock):

sudo shutdown -h 23:30

Send a message

The message goes to all logged-in users:

sudo shutdown -h +10 "System will shut down in 10 minutes. Please save your work."

Cancel a shutdown

sudo shutdown -c
Cancelling the scheduled shutdown

Restart

sudo shutdown -r now

Restart in 5 minutes:

sudo shutdown -r +5

Options

  • -h halt the system.
  • -P power off after halting.
  • -r reboot.
  • -c cancel a scheduled shutdown.
  • -k only send the warning, do not shut down.
  • --no-wall do not send the wall message.

The older options -i, -f and -t come from other systems and do not exist in the shutdown of current systemd-based Linux. To power off at once without a delay you can also run systemctl poweroff, and to restart systemctl reboot.

Use cases

  • Planned maintenance. Schedule a shutdown for a quiet hour.
  • Emergency. Stop the machine now to prevent damage.
  • Restart after updates, for example a kernel update.
Warning: On a remote server a shutdown turns the machine off, and you may not be able to turn it back on. Use -r (reboot) when you are connected through SSH, unless you have console or panel access.

Quick recap

  • shutdown -h now powers off, shutdown -r now restarts.
  • shutdown -c cancels a scheduled one.