While shutting down and restarting your computer might sound trivial, and are perhaps obvious tasks in most cases, there are a number of ways to go about doing these on your Mac, many of which you might not be aware of.
Some of the approaches for shutting down and restarting may be preferred in most situations, but others might be better suited when your Mac is unresponsive, or is otherwise in a jam where the standard options are either not available or not working properly.
The Apple menu
The standard ways to restart and shut down your Mac are in the Apple menu. These options will close each program as cleanly as possible, allowing you to save documents and settings, and quitting them only when they are ready. If a program cannot be cleanly stopped, then it will prevent the shutdown or restart from proceeding.
One option in these routines allows you to interface with Apple’s Resume feature, where in the confirmation dialogue that appears you can check the option to have OS X re-open all of your current programs, if desired. As a word of note, if you hold the Shift key immediately after entering your password at the login window, you can prevent any prior program from opening, and just open your account to the Desktop.
Finally, when you select these options the system will prompt you with a warning to be sure you want to invoke them; however, if you hold the Option key then you will see the little ellipsis (three dots) next to each disappear, and selecting them in this mode will prevent this prompt from displaying. This may be a quicker option for you if you are sure you want to perform these actions.
Since they are the gentlest approaches, in most cases you will use these methods for restarting and shutting down your Mac.
Another approach you can use for restarting your Mac is to use the Terminal, where there are several commands available performing these actions:
sudo shutdown -r now
In addition to “shutdown,” you can use the “reboot” and “halt” commands in similar manners:
sudo reboot sudo halt
These commands will be a little more crude when compared to GUI options, as they will force programs to quit instead of stopping the shutdown process if a program is busy. As a result, they are beneficial to use if the Apple Menu options to not seem to work.
A final Terminal-based option allows you to invoke the standard Restart and Shut Down in the Apple menu, by simply running the AppleScript commands that invoke these reboot actions:
osascript -e 'tell application "System Events" to restart' osascript -e 'tell application "System Events" to shut down'
These last two are perhaps best to use in scripts for scheduled tasks, but in order to work will require your user account be logged in.
Terminal-based approaches can be used for restarting remote systems such as servers; however, if you have FileVault enabled on your remote Mac, then you will run into an issue where the system will restart but then need to be unlocked before OS X can load. Unfortunately without OS X loaded there will be no way to interact with your system and control it.
This problem will occur even if you use Screen Sharing; therefore you need to use the following special command to reboot any FileVault-enabled Mac and have it resume without first needing to be unlocked:
sudo fdesetup authrestart
This command will store your password temporarily for one reboot session, and then restart your system so the disk will be unlocked.
While you can create scripts using the above Terminal commands to restart and shut down your Mac, you also have these options in the Energy Saver system preferences, where you can set your Mac to shut down at a specific time each day, or on specific days of the week. To do this, click the Schedule button at the bottom-right of the Energy Saver system preferences, and then check the options to enable startup or shutdown, followed by setting their schedules accordingly.
This option is perhaps best for managing security and running scheduled maintenance tasks for your various purposes. While it can be useful in some circumstances, in most situations for a personal computer it can be cumbersome and interrupt your workflow if you forget about it.
Scheduling restarts and shutdowns in this manner can also be done in the Terminal using the “pmset” command, which adjusts the system’s power manager in the same ways as the Energy Saver system preferences. This can be done in two ways: a one-time event, and a repeated event. For example, the following will schedule a one-time event to shut down at midnight on January 1, 2015.
sudo pmset schedule shutdown "01/01/15 00:00:00"
To have your Mac always shut down on a specific day, you will need to use the “repeat” option for the “pmset” command, such as the following to have it shut down on midnight every day (note that the times in these commands are in 24-hour format).
sudo pmset repeat shutdown MTWRFSU 00:00:00
You can look up more about the pmset command and its options in the pmset manual page.
Your Mac’s power button
The last approach to restarting and shutting down is to use the power button on your Mac, which has several modes you can use. The first is to hold the button for only a few seconds, where you will see the power panel appear with options for restarting, shutting down, or sleeping your Mac (note you can also press Control-Eject on Macs that have an Eject key). At this panel, you can press the “R” key to restart, or use the tab key to highlight your desired choice followed by invoking it with the Space bar.
This approach will invoke the standard Shutdown and Restart procedures as can be accessed from the Apple menu, and will similarly be relatively gentle on programs. However, this also means that if your Mac is unresponsive and you cannot open the Terminal, then this likewise may not allow you to shut down your system. Therefore, as a last resort, you can perform a hard shutoff of any Mac by holding the Power key down until the system powers off.
You did not mention the command: Control+Eject button
Ah yes, though this invokes the same option as using the Power key, it is more immediate; however, it is only available on Macs with an eject key, and those are only systems with optical drives. Apple has not made a Mac with an optical drive for a while now, but it is still relevant for people who do have these Macs. I’ll update the article to include this.
My iMac has no optical drive, but it does have an eject key, presumably for the times I connect an external optical drive.
Additionally, there are other key commands for variations on restarting:
Command+Control+Eject for a soft restart
Option+Command+Control Eject for a soft shutdown
Option+Command+Power button for a Hard reset, which might be needed if you are frozen out of all interactions.
Unless you chose another option, your iMac came with a wireless Apple keyboard, which has an eject button. The reason, of course, is that this keyboard first became available when Macs still had optical drives and are still in use with such Macs. This keyboard looks like an iMac keyboard but in fact can be used with Mac Pros, Mac minis and even Mac laptops. Ironically, it may not work with external optical drives.
I have a new MacBook Pro retina, which does not have a dedicated eject key, but has a key for power-on like I think the Macbook Air.
Pressing control-power-on gives the exact same dialog as shown in your article.
Also useful are ways to put the Mac to sleep to save energy, including applications that do it for you after downloading, etc, like GoodNight:
Sometimes the only method to restart a Mac, especially in the situation the Mac will not restart using the power button, is to unplug the computer. Take the mac’s power plug out of the surge protector. Wait one minute before plugging the Mac back in. The power button should now function and be able to start and restart the computer.
If you would like to perform multiple events with pmset, such as shut a machine down and then start it up on a schedule you need to define the events within a single pmset command. For example, if you want to shut a machine down at 9:00 PM and turn it back on at 8:00 AM every day you could use:
pmset repeat shutdown MTWRFSU 21:00:00 wakeorpoweron MTWRFSU 08:00:00
To subsequently check your settings use: pmset -g sched
More methods to reboot or shutdown the Mac after failed reboot or shutdown from the Finder or when the USB ports get blocked:
1.-Force Finder quit with Option Command esc.
2.-Force Finder quit with a Script placed in the Desktop AND in the Dock for easier access (one of them may be blocked). I wonder if Topher could make one and share it here.
3.- Control Eject.
4.-Sometimes the Apple – System Preferences is active. Select Startup Disk and Restart.
5.-Control Command Eject (may take about one minute to show prompt to restart with the option to save open documents).
6.-Control Option Command Eject (may take about one minute to show prompt to quit with the option to save open documents).
7.-Restart or shutdown with a wireless keyboard.
8. Configure two Macs for remote access with Timbuktu Pro and restart or shutdown with the other Mac (obviously, must be done in advance)
My mac froze so I had to focefully shut it down with the power button and now it wont reboot?
It just goes to the white screen with the apple and the timer and stays there.
Last time it did this I has to get the whole software reinstalled.
Any suggestions as this keeps happening?
There are two options (that I can think of) that might help solve the issues you are experiencing. The first is to start your Mac in Safe Mode.
1. Shut down your computer and wait 10 seconds.
2. Press the power button.
3. Immediately after you hear the startup tone, hold down the Shift key.
You should press the Shift key as soon as possible after you hear the startup tone, but not before.Release the Shift key when you see the gray Apple logo and progress indicator (spinning gear).
4. To leave safe mode, restart the computer normally without holding down any keys during startup.
When the Mac is started in safe mode, the hard drive is first checked for errors and repaired if errors are found. Safe mode also deletes several OS caches and rebuilds them. A corrupted cache may be preventing your Mac from starting up. In safe mode no third party items such as kernel extensions or start-up items (which may be preventing the Mac from starting up are not loaded. Be patient as booting up in safe mode can take a while. If successful safe mode will take you to your Mac’s log-in screen.
If starting up in Safe Mode fails, then you can try starting up in Recovery Mode:
1. Shut down your computer.
2. Press the power button.
3. Immediately after you hear the startup tone, hold down command +R (i.e. the key with the apple on it + R). You should press the Shift key as soon as possible after you hear the startup tone, but not before.Release the Shift key when you see the gray Apple logo and progress indicator (spinning gear). When the computer has finished booting up you can use disk utility to check and repair the hard drive and repair it (if errors are found). And as a last resort you can re-install your OS, which should leave all your just install OS items and leave your programs and stored files untouched.
I hope this helps. Good luck!