Keep Your OS X Mountain Lion Mac From Sleeping When You Need To [OS X Tips]

Keep Your OS X Mountain Lion Mac From Sleeping When You Need To [OS X Tips]

There are bound to be times when you would like your OS X Mountain Lion Mac to not go to sleep. You can set you Mac to Never sleep in the System Preferences, Energy Saver preferences pane, but that’s not always going to work. Even when it’s set to Never, your Mac may still, in fact, go to sleep. The other problem with the Energy Saver preference is that you only have the ability to set the sleep action to hold of foor three hours, or never. What if you wanted to keep it from sleeping for four hours? Or four and a half hours? Or eight hours?

With a neat little Mountain Lion-only Terminal command, you can set it to whatever you like. Here’s the scoop.

Launch Terminal app, and then type or paste the following command in:

caffeinate -u -t 14400

The number above can be set to any value, as it’s the number of seconds you’d like your Mac to stay awake. You might want to set it to four hours if, for example, you have a large download to take care of, or a huge render in Final Cut Pro or something. Your Mac will not engage the sleep preferences set in the Energy Saver preference panel until the length of time you’ve set for caffeinate is finished.

You can run the command by itself, as well. Just type or paste

caffeinate

into a Terminal window and hit return on your keyboard. When you want to manually stop your Mac from staying awake, go to the Terminal window you entered the caffeinate command and type Control-C on your keyboard to stop the process.

Related
  • aardman

    Or you can download Caffeine free from the App Store.

  • Stuka_UK

    You said
    “You can set you Mac to Never sleep in the System Preferences, Energy Saver preferences pane, but that’s not always going to work. Even when it’s set to Never, your Mac may still, in fact, go to sleep.”

    I’ve never seen that happen.

About the author

Rob LeFebvreAnchorage, Alaska-based freelance writer and editor Rob LeFebvre is Cult of Mac's Culture Editor. He has contributed to various tech, gaming and iOS sites, including 148Apps, VentureBeat, and Paste Magazine. Feel free to find Rob on Twitter @roblef

(sorry, you need Javascript to see this e-mail address)| Read more posts by .

Posted in OS X, Tips & Tricks | Tagged: , , , , , |