Schedule or Cancel a Shutdown or Restart from the Terminal

Halt or restart the Mac now, or N minutes from now, with shutdown — and cancel a pending one with killall.

macOSrebootTerminalshutdownMedium risk
Run sudo shutdown -r now to restart immediately, or sudo shutdown -h +30 to schedule a power-off in 30 minutes.

01Command

Command
$ sudo shutdown -h +30   # halt in 30 minutes; sudo shutdown -r now restarts now

02What it does

shutdown accepts a +time argument in minutes and broadcasts a warning to all logged-in users before acting, which makes the delayed form perfect for 'shut down when this export finishes'. -h halts and powers off, -r reboots. While a delayed shutdown is pending, a second shutdown run prints its time, and sudo killall shutdown cancels it.

03Risk

RiskMedium risk
RequirementsRequires an administrator password.
!Warning: Unsaved work in open apps will block or be lost depending on the app; warn users on a shared Mac first.

04Undo

Undo
$ sudo killall shutdown

05Sources

  • shutdown(8) man page
    manpagez.com · technical · 2026-09-17
    Evidence: The shutdown man page shows -h (halt/power-off), -r (reboot) and the +time argument for a delayed shutdown, with a broadcast warning to logged-in users.
  • shutdown - Halt, Power-off or Reboot the Machine
    SS64 · technical · 2026-09-17
    Evidence: Documents shutdown -h to halt, -r to reboot, and the +time form for scheduling the shutdown N minutes in the future.

Last verified: 2026-09-19 · Category: System & Settings

06Related solutions