Restart or Shut Down Your Mac from the Terminal with shutdown

Reboot or power off macOS with the built-in shutdown command — handy when the menu bar or remote session misbehaves.

macOSTerminalPower & SleepMedium risk
Run sudo shutdown -r now to restart immediately, or sudo shutdown -h now to shut down.

01Command

Command
$ sudo shutdown -r now

02What it does

shutdown is Apple's built-in command for cleanly stopping or restarting the system: -r reboots, -h halts and powers off, and the time can be 'now' or a scheduled time. Unlike killing the power, a clean shutdown lets apps and macOS save state, so running apps quit gracefully. It works over SSH and screen sharing too, which makes it the go-to fix for a remote Mac that has an unresponsive interface.

03Risk

RiskMedium risk
RequirementsRequires administrator (sudo) privileges.
!Warning: Unsaved work in open apps can be lost — apps may be force-quit during the shutdown. Double-check the flag: -r restarts, -h shuts down for good.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • SHUTDOWN(8) - macOS manual page
    Apple (Xcode man pages mirror) · vendor-doc · 2026-09-17
    Evidence: The manual page contains 'shutdown -r' for rebooting and explains the time argument can be the word 'now' or a future time in yymmddhhmm format.
  • shutdown - Shut down or restart the system
    SS64 · technical · 2026-09-17
    Evidence: Documents the shutdown syntax including '-r Reboot the system' and '-h Halt or power off', with time arguments such as 'now'.

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

06Related solutions