caffeinate - A Terminal Command to Temporarily Prevent your Mac from Sleeping
A User Tip Authored by TheLittles of the Apple Support Community:
caffeinate - A Terminal Command to Temporarily Prevent your Mac from Sleeping
Ever streamed with Netflix or YouTube, and your Mac falls asleep? Well, why download a third-party application, or fiddle with Settings/Preferences, when all you need to do is run one command in Terminal? There is an easy workaround...
Launch the caffeinate Terminal command:
caffeinate
When complete, end this command in Terminal with [control + C]
A. What you'll Avoid with caffeinate:
- Unnecessary purchasing of a Third-Party Application
- Frustratingly fiddling with your Display settings in System Settings (formerly called Preferences)
B. Why to Use caffeinate:
- Prevent your Mac from sleeping while streaming content (i.e. Netflix and YouTube).
- Prevent loss of data from not-responding applications
- Prevent Boot Loops from occurring while updating with iTunes or Finder
C. How to Use caffeinate:
Launching the caffeinate command in Terminal:
- Go to: Applications folder
- Click: Utilities subfolder
- Open: Terminal
- Type: caffeinate (Screenshot 1.)
- Launch: caffeinate [Press: return] (Screenshot 2.)
- Perform: your task (i.e Streaming Netflix and YouTube content).
- Go to: Terminal
- End: caffeinate running[Hold Down: control + Press: C] (Screenshot 3.)
- Close: Terminal
-------
NOTES:
- Based on:
My Reply to this thread: Mac sleeps during Netflix despite sleep settings - Apple Community
- Screenshots:
Personal info is blocked out with red-colored rectangles
Screenshot 1.
Typing caffeinate in Terminal:
Screenshot 2.
Launching caffeinate in Terminal:
While running, a grey-box will appear one character on the proceeding line:
Screenshot 3.
Ending caffeinate:
There is a caret, followed by a C. The default command shell is shown in the next line, indicating the command has stopped.