How to keep your Mac awake
Open Terminal and type caffeinate -d: the Mac and its display stay awake until you press Control-C. Nothing in your settings changes, so when you stop it, the Mac sleeps on its usual schedule again.
The built-in ways
- Terminal:
caffeinate -dkeeps the display awake until you press Control-C.caffeinate -d -t 3600does it for an hour. - System Settings › Lock Screen — set “Turn display off when inactive” to a longer time. It stays that way until you change it back.
One click
Questions
Does caffeinate change my settings?
No. It only holds the Mac awake while it runs; press Control-C or close the Terminal window and the usual sleep settings apply again.
Will the Mac sleep when I close the lid?
Yes. Closing a MacBook’s lid puts it to sleep as usual, unless it is connected to power and an external display; keeping it awake with the lid open doesn’t change that.
How do I keep it awake for a set time?
Add -t and the number of seconds: caffeinate -d -t 7200 keeps the display on for two hours and then lets it sleep.