caffeinate - A Terminal Command to Temporarily Prevent your Mac from Sleeping

Last modified: Jun 28, 2026 6:20 AM
5 7971 Last modified Jun 28, 2026 6:20 AM

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:

  1. Go to: Applications folder
  2. Click: Utilities subfolder
  3. Open: Terminal
  4. Type: caffeinate (Screenshot 1.)
  5. Launch: caffeinate [Press: return] (Screenshot 2.)
  6. Perform: your task (i.e Streaming Netflix and YouTube content).
  7. Go to: Terminal
  8. End: caffeinate running[Hold Down: control + Press: C] (Screenshot 3.)
  9. 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.

Comments

Feb 18, 2026 8:09 AM

Great tip! Do you mean the caret symbol in #3 (and not carrot)? You could mention control + C in the tip as you did in your discussion reply.

Feb 18, 2026 8:09 AM

Feb 18, 2026 12:13 PM

6x6 Said:

Great tip! Do you mean the caret symbol in #3 (and not carrot)? You could mention control + C in the tip as you did in your discussion reply.

———-


Thank you for that.


No worries —[control + C] is already mentioned. As for vocab, I made some grammatical and formatting errors:

  • misspelling of “caret”
  • the misspelling of “form” to “from”, (which I have a tendency of mistyping)
  • a few indentations.

Feb 18, 2026 12:13 PM

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.