shutdown Command in Linux: Power Off, Reboot, and Schedule

By 

Updated on

5 min read

shutdown command in a Linux terminal used to power off and reboot the system

The shutdown command brings the system down in a secure way. When a shutdown is initiated, all logged-in users and processes are notified that the system is going down, and no further logins are allowed. You can shut down your system immediately or schedule it for a specific time.

This guide explains the most common shutdown options with practical examples.

Syntax

The shutdown command takes the following form:

txt
shutdown [OPTIONS] [TIME] [MESSAGE]
  • OPTIONS — the action to perform: power off (default), halt, or reboot
  • TIME — when to perform the shutdown: now, +m (minutes from now), or hh:mm (absolute time)
  • MESSAGE — a message broadcast to all logged-in users

Only root and users with sudo privileges can run shutdown.

On modern Linux distributions, shutdown is a compatibility alias for systemctl. Both commands control the same systemd targets.

Power Off the System

When used with no arguments, shutdown powers off the machine after a one-minute delay:

Terminal
sudo shutdown

To power off immediately, use now:

Terminal
sudo shutdown now

The +0 argument is equivalent to now:

Terminal
sudo shutdown +0

Power Off with -h

The -h flag halts or powers off the system. On most modern systems with systemd, -h behaves the same as the default power-off action:

Terminal
sudo shutdown -h now

To power off at a specific time:

Terminal
sudo shutdown -h 11:00

To power off in 30 minutes:

Terminal
sudo shutdown -h +30

Use -P to make the power-off behavior explicit, regardless of system defaults:

Terminal
sudo shutdown -P now

Use -H to halt the system without powering off the hardware (the machine stops but remains powered):

Terminal
sudo shutdown -H now

Reboot the System

To reboot, use the -r flag:

Terminal
sudo shutdown -r now

You can specify a delay and a custom message:

Terminal
sudo shutdown -r +5 "Updating kernel"

The command above reboots the system after 5 minutes and broadcasts Updating kernel to all logged-in users.

Schedule a Shutdown

The TIME argument accepts two formats:

  • +m — number of minutes from now
  • hh:mm — absolute time in 24-hour format

To schedule a shutdown in 10 minutes:

Terminal
sudo shutdown +10

To schedule a shutdown at 02:00:

Terminal
sudo shutdown 02:00

Broadcast a Custom Message

To send a message to all logged-in users along with the standard shutdown notification, add it after the time argument:

Terminal
sudo shutdown +30 "Hardware upgrade in progress"

A time argument is required when specifying a custom message.

Cancel a Scheduled Shutdown

To cancel a pending shutdown, use the -c flag:

Terminal
sudo shutdown -c

You can include an optional message to notify users the shutdown has been cancelled:

Terminal
sudo shutdown -c "Shutdown cancelled"

Quick Reference

CommandDescription
sudo shutdown nowPower off immediately
sudo shutdown -h nowHalt or power off immediately
sudo shutdown -r nowReboot immediately
sudo shutdown +10Power off in 10 minutes
sudo shutdown 02:00Power off at 02:00
sudo shutdown -r +5 "msg"Reboot in 5 minutes with a message
sudo shutdown -H nowHalt without powering off
sudo shutdown -P nowPower off explicitly
sudo shutdown -cCancel a scheduled shutdown

Troubleshooting

sudo shutdown requires a password or is not permitted
Your user account does not have sudo privileges. Add the user to the sudo group with sudo usermod -aG sudo username, or ask a system administrator to run the command.

Scheduled shutdown does not trigger
Check that the system clock is set correctly with timedatectl. If the absolute time you specified has already passed for today, the shutdown will be scheduled for the same time the following day.

-h does not power off the hardware
On some systems, -h halts the CPU but does not cut power. Use -P to explicitly request a power-off, or use sudo poweroff directly.

FAQ

What is the difference between shutdown -h, shutdown -P, and shutdown -H?
-h is a combined flag that halts or powers off, depending on the system default — on most modern systemd systems it powers off. -P always powers off the hardware. -H halts the CPU and operating system but leaves the machine powered on.

What is the difference between shutdown now and poweroff?
Both achieve the same result on a systemd system. shutdown now is the traditional command that works across most Unix-like systems and sends broadcast notifications to users. poweroff is a direct systemd alias that powers off immediately with no delay or notification.

Can I schedule a daily shutdown with shutdown?
The shutdown command schedules a one-time event, not a recurring one. For recurring shutdowns, use a cron job: 0 22 * * * /sbin/shutdown -h now shuts the system down at 22:00 every day.

How do I reboot from the command line without shutdown?
Use sudo reboot or sudo systemctl reboot. Both are equivalent to sudo shutdown -r now on systemd systems.

Conclusion

The shutdown command lets you power off, halt, or reboot a Linux system immediately or on a schedule. Use shutdown -h now for the most portable power-off command, -r to reboot, and -c to cancel any pending shutdown. For managing system services, see the systemctl guide .

Linuxize Weekly Newsletter

A quick weekly roundup of new tutorials, news, and tips.

About the authors

Dejan Panovski

Dejan Panovski

Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page