How To Use a Built-In Terminal Command to Keep Your Mac From Sleeping

Posted in How To, Mac on 20/03/2017 by Chris Hauk


While we usually want our Mac’s to go to sleep if they haven’t been used for awhile – saves energy, don’t ya know – there are times we don’t want it to go to sleep, such as when we’re getting ready to give a presentation and such.

While there are a number of third-party apps that will turn temporarily keep you Mac awake, or you can turn it off in System Preferences, there’s a quicker way to toggle Energy Saver modes on your Mac, and you can do it via a built-in command entered from the command line in Terminal.

Keep Your Mac Awake

Launch the Terminal app. You can find it in The “Applications” -> “Utilities” folder. You can also hit the “Command + Space Bar” hotkey combo and enter “Terminal” into Spotlight to run it.

When the Terminal prompt appears, enter the following command and press the Return key:


It will look like absolutely nothing happened, but you’ll notice the Terminal window’s status bar says “caffeinate,” which means the command is running.

How To Use a Built-In Terminal Command to Keep Your Mac From Sleeping

While caffeinate is running, you won’t notice anything different except for one thing, no matter how long you leave your Mac running, it will not go to sleep.

Now, when you’re finished with the reason you didn’t want your Mac to go to sleep, simply press “Control + C” simultaneously on your keyboard. The caffeinate command will stop running, and you’ll see the Terminal window’s status bar return to normal. You machine will now sleep according to the Energy Saver settings you have in place.

How To Use a Built-In Terminal Command to Keep Your Mac From Sleeping

For more tips and tricks on how to make better use of your Mac, iOS device, Apple Watch, or Apple TV, be sure to visit the “How To” section of our website.

(Via TekRevue)


Chris Hauk

MacTrast Senior Editor, and self-described "magnificent bastard," Chris Hauk owns Phoenix Rising Services and writes for everyone's favorite "bad movie" website, Big Bad Drive-In.

His first Apple product was an iPod Classic 9 years ago, and he has since added a MacBook Pro, a number of iPads, iPhones, and multiple Apple TVs to his collection.

He lives somewhere in the deep Southern part of America. Yes, he has to pump in both sunshine and the Internet.