
If the display is off, this option turns the display on and prevents the display from going into idle sleep. This is valid only when system is running on AC power. -s - Prevent the system from sleeping.-i - Prevent the system from idle sleeping.-d - Prevent the display from sleeping.Using Caffeinate’s OptionsĪpple understands that each person using this command may have different needs and has provided a number of different options to let users decide what is needed in their situation. Tip: The brackets around the command ( ) are there for demonstation, but would not be used around a normal command such as open. This can be done in the following way:Ĭaffeinate -arguments The caffeinate command can also be linked to other commands, such as cloning a git repository, by linking caffeinate to a specific command. For example, if you wanted to prevent your Mac from sleeping for 5 hours, you would run the following command: Luckily, Apple has made this rather easy to accomplish by using the -t option to your command, followed by the time in seconds. Other times, you may prefer to set the duration you would like to prevent the Mac from sleeping. While running, caffeinate will leave a blank prompt.įor some situations, such as while watching a movie, this may be fine. To stop the process from running, you can press Ctrl+ C which will instantly end the process, and return you to the command prompt.

While running, caffeinate will prevent your Mac from sleeping. When run, the cursor will move down to a blank line where it will stay until you tell the command to stop running or close the terminal. The simplest way to use this command is to run the following command in the terminal.


The caffeinate command is used to prevent a Mac from going to sleep.
INSOMNIAX LOGS OUT WHEN I SHUT DOWN HOW TO
Let’s take a look at how to use this command, and some alternatives for older machines. With OS X 10.8, Mountain Lion, we are able to stop our Macs from sleeping for a period of time from our command line with the caffeinate command. When in these situations, it can be inconvenient to look through System Preferences > Energy Saver until you find the settings needed and then you must remember to re-enable your original settings when you are done.
INSOMNIAX LOGS OUT WHEN I SHUT DOWN DOWNLOAD
Yet there are times you may want to stop your Mac from sleeping such as when you’re watching a movie, cloning a large repository from GitHub, or need to let a large download finish from your favorite website. Computers sleep as a way to save energy and prevent unnecessary wear on your machine's hardware.
