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

By 

•

Updated on

•

8 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 Ubuntu, Debian, Fedora, and other distributions that use systemd, shutdown is a symbolic link to systemctl. Both commands control the same systemd targets.

Command Options

The most common shutdown options are:

  • -P, --poweroff - Power off the machine (this is the default)
  • -h - Equivalent to -P, unless --halt is specified
  • -H, --halt - Halt the machine without cutting power
  • -r, --reboot - Reboot the machine
  • -k - Do not shut down; only send the warning message to logged-in users
  • --no-wall - Shut down without sending a warning message
  • -c - Cancel a pending scheduled shutdown
  • --show - Show the pending shutdown, if there is one (systemd 250 or newer)

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

When you schedule a shutdown, systemd confirms the time and reminds you how to cancel it:

output
Shutdown scheduled for Thu 2026-06-25 14:30:00 CEST, use 'shutdown -c' to cancel.

The shutdown request is stored by systemd, so the confirmation appears immediately while the system keeps running until the scheduled time. Five minutes before that time, systemd creates the /run/nologin file, and non-root users can no longer log in.

To schedule a shutdown at 02:00:

Terminal
sudo shutdown 02:00

On systemd 250 or newer, use --show to check whether a shutdown is pending and when it will run. Ubuntu 22.04 ships systemd 249 and does not support this option:

Terminal
sudo shutdown --show

The output is the same line you saw when the shutdown was scheduled:

output
Shutdown scheduled for Thu 2026-06-25 14:30:00 CEST, use 'shutdown -c' to cancel.

When nothing is scheduled, the command prints No scheduled shutdown. instead.

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.

To send the warning without shutting the system down, add the -k option:

Terminal
sudo shutdown -k +10 "Testing the maintenance warning"

systemd still prints the Shutdown scheduled line, and --show lists the pending dry run. When the time comes, systemd skips the power-off and the system keeps running. To clear the dry run earlier, use sudo shutdown -c.

Warning
The -k option still creates /run/nologin five minutes before the scheduled time, temporarily blocking new non-root logins. In the example above, logins are blocked after five minutes. Cancelling the dry run or letting it finish removes the file.

If you only need to send a message to logged-in users, use the wall command instead. On Ubuntu 26.04 and Debian 13, users connected over SSH do not receive these broadcasts. The wall guide explains why and how to reach them .

Cancel a Scheduled Shutdown

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

Terminal
sudo shutdown -c

The command prints nothing when it succeeds. On systemd 250 or newer, run sudo shutdown --show again to confirm that the shutdown is gone.

When you cancel a shutdown, systemd sends System shutdown has been cancelled to the terminals of logged-in users. The -c option also accepts a message argument, but systemd ignores it and sends its own text.

shutdown vs poweroff, halt, and systemctl

The shutdown command is not the only way to power off a Linux system from the terminal. On systemd distributions, poweroff and halt are also symbolic links to systemctl:

  • sudo poweroff - Power off immediately, the same as sudo systemctl poweroff
  • sudo halt - Halt the system without cutting power, the same as sudo systemctl halt
  • sudo shutdown now - Power off immediately through the traditional shutdown interface

On a systemd machine, shutdown now and poweroff give the same result. The difference is scheduling. shutdown accepts a time argument and a wall message, so you can warn users and power off later. poweroff requests an immediate power-off directly; use poweroff --no-wall if you do not want a wall message.

systemd 254 and newer can also schedule the action from systemctl with the --when= option. To power off in ten minutes, run:

Terminal
sudo systemctl poweroff --when=+10min

This creates the same scheduled request as shutdown. sudo shutdown --show lists it, and sudo shutdown -c cancels it.

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 -k +10Warn without shutting down; temporarily block new logins
sudo shutdown --showShow the pending shutdown (systemd 250 or newer)
sudo shutdown -cCancel a scheduled shutdown
sudo systemctl poweroff --when=+10minPower off in 10 minutes using systemd 254 or newer

Troubleshooting

Failed to schedule shutdown: Access denied as the requested operation requires interactive authentication
You ran shutdown without sudo. Run the command again with sudo. If sudo reports that your user is not in the sudoers file, the account does not have sudo privileges. From an account with root access, add the user to the sudo group with sudo usermod -aG sudo username, or ask a system administrator to run the command.

bash: shutdown: command not found on Debian
On Debian, the default PATH for regular users does not include /usr/sbin, where shutdown is installed. Run the command with sudo, which searches /usr/sbin. If sudo is not installed, switch to root with su - and run shutdown now from the root shell. To give your user sudo access, see how to add a user to sudoers on Debian .

Scheduled shutdown does not trigger
On systemd 250 or newer, run sudo shutdown --show to see when the shutdown is actually scheduled. On older versions, check the confirmation printed when you scheduled it. Check that the system clock and time zone are 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 systemd, -h always requests a power-off unless you also pass -H. If the machine stops but stays powered on, check that the command did not include -H and that you did not run halt. 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 shorthand for -P and powers off the machine, unless you combine it with -H. -P always powers off the hardware. -H halts the CPU and operating system but leaves the machine powered on.

Can I schedule a daily shutdown with shutdown?
The shutdown command schedules a one-time event, not a recurring one. For recurring shutdowns, add a cron job to the root crontab with sudo crontab -e. The line 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.

Does Linux support shutdown -s -t 0?
No. The -s flag belongs to the Windows shutdown command, and Linux rejects it with shutdown: invalid option -- 's'. The -t flag is accepted for compatibility, but systemd ignores it together with its argument. As a result, shutdown -t now does not power off immediately; it schedules a power-off in one minute, the same as shutdown with no time. The legacy -a, -f, and -F flags are ignored the same way, so shutdown -f now is just shutdown now. To power off immediately, use sudo shutdown now or sudo shutdown +0.

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, --show to check a pending shutdown, and -c to cancel it. 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 1000+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.

View author page