Skip to content

shutdown MacOS Command Guide

To shut down your MacOS system, you can use the “shutdown” command in the Terminal. This command allows you to specify when to shut down, restart, or sleep your Mac, as well as send notifications to users. By using various options such as -h, -r, and -s, you can customize the shutdown behavior to meet your needs. Additionally, the “shutdown” command provides a countdown timer, giving you time to save your work before the system powers off. Mastering the shutdown command can help you manage your Mac’s power efficiently and effectively.

shutdown Syntax:

Terminal window
shutdown [option] [time] [message]

Options:

OptionDescription
-rRestart the system
-hHalt the system (shut down)
-sSleep the system
-h nowShut down the system immediately
-r nowRestart the system immediately

Parameters:

ParameterDescription
timeSpecifies the time when the shutdown will occur
messageSpecifies a message to be displayed to users

shutdown Command Samples:

Shutdown Immediately

Terminal window
sudo shutdown -h now

Shuts down the system immediately.

Shutdown in 30 minutes

Terminal window
sudo shutdown -h +30

Schedules a shutdown to occur in 30 minutes.

Shutdown at a Specific Time

Terminal window
sudo shutdown -h 22:00

Schedules a shutdown to occur at 10:00 PM.

Cancel a Scheduled Shutdown

Terminal window
sudo shutdown -c

Cancels a previously scheduled shutdown.

Reboot Immediately

Terminal window
sudo shutdown -r now

Reboots the system immediately.

Reboot at a Specific Time

Terminal window
sudo shutdown -r 07:30

Schedules a reboot to occur at 07:30 AM.

Log Out All Users and Restart

Terminal window
sudo shutdown -r +1

Logs out all users and restarts the system after 1 minute.

shutdown FAQ:

How do I use shutdown in MacOS?

To use the shutdown command in MacOS, execute the following command:

Terminal window
shutdown --option <value>

What are some common options for the shutdown command in MacOS?

Some common options for the shutdown command in MacOS include:

Terminal window
shutdown -h # Halt the system
shutdown -r # Restart the system
shutdown -s # Put the system to sleep

How can I schedule a shutdown for a specific time in MacOS?

To schedule a shutdown for a specific time in MacOS, use the following command with the desired time:

Terminal window
shutdown -h 20:00 # Shutdown the system at 8:00 PM

Can I cancel a scheduled shutdown in MacOS?

Yes, you can cancel a scheduled shutdown by using the following command:

Terminal window
shutdown -c # Cancel the scheduled shutdown

How can I add a custom message when scheduling a shutdown in MacOS?

To add a custom message when scheduling a shutdown in MacOS, use the following command with the desired message:

Terminal window
shutdown -h +10 "System will shutdown in 10 minutes for maintenance"

Is there a way to force immediate shutdown in MacOS?

Yes, you can force an immediate shutdown in MacOS by using the following command:

Terminal window
shutdown -h now # Force an immediate shutdown

Applications of the shutdown command

  • Shutting down the macOS system
  • Restarting the macOS system
  • Putting the macOS system to sleep
  • Hibernating the macOS system