TL;DR
Your Mac falls asleep during a long download? One built-in Terminal command keeps it awake β for as long as you need.
How to do it
- Open Terminal (Cmd+Space β type "Terminal").
- Type:
caffeinateand press Enter. - Done β your Mac will stay awake as long as the Terminal window is open.
- To stop: Press Ctrl+C in Terminal β your Mac will sleep normally again.
Useful variations
caffeinate -dβ Display stays on too (not just the system).caffeinate -t 3600β Mac stays awake for exactly 1 hour (3600 seconds).caffeinate -w 1234β Mac stays awake until process 1234 finishes (great for long-running scripts).
Why this helps
caffeinate is a built-in macOS tool that temporarily overrides power management. No download, no app β it's already on your Mac.
Perfect for: downloads, backups, long scripts, presentations, or anytime you don't want your Mac to fall asleep.
Fun fact: The name is a pun on caffeine β it keeps your Mac "caffeinated." β
β οΈ Don't forget: Press Ctrl+C when you're done β otherwise your Mac will never sleep and your battery will drain.