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:
shutdown [option] [time] [message]
Options:
Option | Description |
---|---|
-r | Restart the system |
-h | Halt the system (shut down) |
-s | Sleep the system |
-h now | Shut down the system immediately |
-r now | Restart the system immediately |
Parameters:
Parameter | Description |
---|---|
time | Specifies the time when the shutdown will occur |
message | Specifies a message to be displayed to users |
shutdown Command Samples:
Shutdown Immediately
sudo shutdown -h now
Shuts down the system immediately.
Shutdown in 30 minutes
sudo shutdown -h +30
Schedules a shutdown to occur in 30 minutes.
Shutdown at a Specific Time
sudo shutdown -h 22:00
Schedules a shutdown to occur at 10:00 PM.
Cancel a Scheduled Shutdown
sudo shutdown -c
Cancels a previously scheduled shutdown.
Reboot Immediately
sudo shutdown -r now
Reboots the system immediately.
Reboot at a Specific Time
sudo shutdown -r 07:30
Schedules a reboot to occur at 07:30 AM.
Log Out All Users and Restart
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:
shutdown --option <value>
What are some common options for the shutdown command in MacOS?
Some common options for the shutdown command in MacOS include:
shutdown -h # Halt the systemshutdown -r # Restart the systemshutdown -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:
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:
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:
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:
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