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.
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 now02What 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
!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 shutdown05Sources
- shutdown(8) man pageEvidence: 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 MachineEvidence: 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
Change where screenshots are saved on Mac
Point macOS screen captures at any folder you choose instead of the desktop.
Download a file from a URL on Mac with curl
Grab any file from the web straight into the current folder — no browser needed.
Find files larger than 500 MB on Mac
List the biggest files in your home folder that are eating disk space.