Introduction
If you prefer the command line or need to restart a remote Mac, knowing how to restart a Mac from Terminal is an essential skill. Terminal gives you precise control over exactly when the restart happens—immediately, after a delay, or on a recurring schedule. For everyday restarts, the Apple menu works perfectly, but the command line offers power and flexibility that the graphical interface cannot match.
This guide covers the two primary restart commands, how to cancel a pending restart, and how to schedule restarts at specific times. For a broader look at all restart methods, see our how to restart a Mac guide . If your computer is frozen and you cannot reach Terminal, our force restart a frozen Mac guide covers the emergency steps.
The Two Primary Restart Commands
There are two main commands to restart a Mac from Terminal. Both require administrator privileges, so you will be prompted for your password.
The standard command uses shutdown with the restart flag:
text
sudo shutdown -r now
The -r flag means “restart,” and now tells the system to begin immediately. After you press Return and enter your password, the computer begins the restart process in about one minute by default. Applications receive a brief window to save any work, but it is always safer to save before executing the command.
The second option is the reboot command:
text
sudo reboot
This command is even simpler and has no built‑in delay. It begins the restart process right away. Both commands achieve the same result, so use whichever you prefer. For shutdowns instead of restarts, replace -r with -h (halt) in the shutdown command.
How to Restart with a Delay
A major advantage of using Terminal to restart a Mac from Terminal is the ability to schedule a restart minutes or hours in the future. This is useful when you want to give yourself time to finish a task or save work before the system restarts.
To restart in 10 minutes:
text
sudo shutdown -r +10
Replace 10 with the number of minutes you want to wait. The system sends a notification to all logged‑in users warning them of the impending restart. Your own Terminal session will display a countdown. To restart at a specific absolute time—say, 11:30 PM—use:
text
sudo shutdown -r 23:30
The time must be in 24‑hour format. This is especially handy for scheduling an overnight restart or coordinating with server maintenance windows. For more information on setting up regular, recurring restarts, see our schedule automatic Mac restarts guide .
How to Cancel a Scheduled Restart
If you initiate a delayed restart and then change your mind, you can cancel it. To do this, open Terminal and run:
text
sudo killall shutdown
This terminates the scheduled shutdown or restart process. The command works as long as the restart has not already begun. If you see a countdown in your Terminal window, run the killall command immediately to stop it. There is no confirmation message after cancellation, but you can verify success by checking that the countdown no longer appears.
How to Restart a Remote Mac via SSH
For system administrators and advanced users, the ability to restart a Mac from Terminal extends to remote machines. If you have SSH enabled on the remote Mac, connect with:
text
ssh username@remote-ip-address
Once connected, use the same sudo shutdown -r now or sudo reboot commands. You will be prompted for the password of the user account on the remote Mac, not your local one. Make sure you save any open work on the remote machine before executing the command—you will not see the standard desktop reminders on a remote connection.
Restart with a Custom Message
You can combine the delay flag with a custom broadcast message that explains why the restart is happening. This is especially helpful on shared computers:
text
sudo shutdown -r +5 "System will restart for maintenance in 5 minutes. Please save your work."
All users currently logged in to the Mac will see the message in a notification. The message must be in quotes and appear after the time parameter. This small courtesy can prevent lost work and frustrated colleagues.
Frequently Asked Questions
What is the difference between shutdown -r and reboot?
Both restart the system. shutdown -r can include a delay and custom message. reboot is simpler but always restarts immediately.
Do I lose my work when restarting from Terminal?
Yes, if you have unsaved documents open. Terminal does not automatically save work. Save all open documents before executing a restart command.
Can I restart without entering my password?
No. The sudo command requires administrator authentication. This protects against unauthorized restarts.
How do I restart into recovery mode from Terminal?
You cannot reboot directly into recovery mode from Terminal. Shut down the Mac, then press and hold the Power button on Apple Silicon or hold Command+R during startup on Intel Macs. For more details, see our Mac restart keyboard shortcuts guide .
