Name

shutdown — stdin  stdout  - file  -- opt  --help  --version

Synopsis

shutdown [options] time [message]

The shutdown command shuts down or reboots OS X; only the superuser may run it. Here’s a command to shut down the system in 10 minutes, broadcasting the message “scheduled maintenance” to all users logged in:

sudo shutdown -h +10 "scheduled maintenance"

The time may be a number of minutes preceded by a plus sign, like +10; an absolute time in hours and minutes, like 16:25; or the word now to mean immediately.

With no options, just a time, shutdown puts the system into single-user mode, a special maintenance mode in which only one person is logged in (on the desktop), and all nonessential services are off.

sudo shutdown now

To exit single-user mode, either perform another shutdown to halt or reboot, or type ^D to bring up the system in normal, multiuser mode.

Useful options

-r

Reboot the system.

-h

Halt the system.

Get Macintosh Terminal Pocket Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.