Can I shut down my mac with the keyboard only?
I dont want to force shut down (like holding the power key), I want to shut it down normally.
If you have a keyboard with an eject key, you can use ⌃⌥⌘⏏ (control-option-command-eject).
If you have a laptop with a power key in place of an eject key, the power key can be substituted for eject in 10.8 and newer versions of OS X.
Other keyboard shorcuts:
My keyboard doesn't have an eject or power key, so I normally use Alfred:
You could also assign a keyboard shortcut to a script like this:
tell app "System Events" to shut down
The shut down
command sends loginwindow
a kAEShutDown
Apple event, which starts a normal shut down sequence as described in the Daemons and Services Programming Guide. sudo shutdown -h now
does not for example allow graphical applications to ask for confirmation if there are unsaved changes.
Well, while it's not "keyboard only" per se, you can open up a terminal and type in sudo shutdown -h now
, which will send a signal to the kernel to shutdown the computer.
I'm not sure if that was exactly what you were looking for, but it should be a viable solution.
Apparently, another option is to use Command-Option-Control-Media Eject key, which will quit all applications and let you save documents/work and then shuts down the mac.
Cmd-Space
to open Spotlight search, type Terminal
, press Return
.
Open Keyboard Shortcuts in System Preferences. Click on Applications Shortcuts in the list at left.
Click on the "plus" sign and choose "All Applications" in the pulldown menu. Type in "Shut Down" (WITHOUT the ellipses you'd find after this command in the Apple Menu) and choose whatever keyboard shortcut you want.
(I typically put SHIFT-OPT-COMMAND in front of all of my shortcuts so it's harder to hit them by accident.)a
Restart your Mac and your new command should show up in the Apple Menu below the normal "Shut Down…" command, along with its new keyboard shortcut.
p.s. you can use this for Sleep and Restart, too.
This will work unless you changed the keyboard shortcut to access the menu bar in System Preferences » Keyboard » Keyboard Shortcuts » Keyboard & Text Input.