Mountain Lion Allows Disable Sleep From The Command Line With caffeinate

In OS X Mountain Lion, Apple has bundled a command line tool for disabling sleep, named caffeinate.

Caffeinate can prevent sleep entirely, but you can also modify the command with various arguments to prevent just the display from sleeping, provide a specified time to avoid sleeping, prevent sleeping while a command runs, and more.

To temporarily disable sleep, run this command from Terminal:

caffeinate

You can also run caffeinate for a set amount of time to prevent sleeping:

caffeinate -t 21600

The number attached to the -t flag is the amount of time in seconds for sleep to be disabled.

Caffeinate can also be attached to other commands to prevent the Mac from sleeping while the command runs:

caffeinate [command_to_run] -arguments

That causes the Mac to avoid sleep only as long as it takes to run the command provided, after which the normal sleep rules apply.

Via : MacOSXHints

Tagged with: , , , , , , ,
Posted in Macintosh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Enter your email address to follow this site and receive notifications of new posts by email.

Join 197 other subscribers
Categories
Archives
Colophon
wordpress com stats plugin
%d bloggers like this: