Your Mac goes to sleep after a few idle minutes, which is a good thing—your battery wouldn't last very long otherwise. Every once in a while, though, that's not what you want.
I ran into this once during a brainstorming session a few years ago. My coworker and I were looking at a document on their MacBook, which was connected to a TV. The Mac kept falling asleep, and my coworker was annoyed about having to get up and move the mouse every now and then.
I walked over to the Mac, opened a window, typed one word, and the problem was solved. Am I a wizard? Yes, but that's not how I did this. I just know a tip you don't—until now.
Amaze your friends with this one weird trick
What I did wasn't complicated. First I opened the Terminal. You can find it in Applications > Utilities, but I find it fastest to press command+Space
and type "Terminal." Here's what the Terminal looks like:
This might look scary, but don't worry—it's just a place you can tell the computer to do stuff by typing words. Think of it as the 1970s Siri.
In this case, we're going to type "caffeinate" and hit return
.
That's it. The Mac will now stay awake. You can end this by pressing control+C
with the Terminal window open, or by closing the Terminal window.
There are other ways you can do the same thing. A free app called Amphetamine can do this from the menu bar, along with some other tricks. And you can also go into Battery (Big Sur) or Energy Saver (older versions) in System Preferences and tell your Mac not to go to sleep there.
But neither of those approaches is great for temporarily preventing sleep on a Mac that's not yours. Changing the settings means someone has to remember to change them back, which is annoying at best. Installing software for a one-time thing can feel like overkill (and, depending on the situation, might not be possible without an admin password).
The Terminal command caffeinate works on every Mac, is instant, and is easy to stop. And you don't even have to remember how to spell the word: just type "caf" and hit tab
. The Mac will complete the word for you.
It's effective, and it makes you look way cooler than you are. Try it sometime.