← All Tips
πŸ’»Mac⚑Productivity 2 min read

caffeinate: Keep Your Mac Awake with One Terminal Command

TL;DR
Keep your Mac awake for downloads, backups, or long scripts with `caffeinate`, a time limit, or a command-bound session.
Checked 1 source Season: All year

caffeinate: Keep Your Mac Awake with One Terminal Command

Start quickly

Open Terminal and run:

caffeinate

While this command is running, macOS prevents normal idle sleep. Stop it with Ctrl+C in Terminal. After that, your usual Energy settings apply again.

This is useful for large downloads, backups, file transfers, long scripts, or presentations when you do not want to change System Settings just for one task.

Better variations

For most cases, a targeted version is better than leaving plain caffeinate running forever:

caffeinate -t 3600

Keeps the Mac awake for 1 hour. The time is in seconds.

caffeinate -d

Also keeps the display awake. Useful for presentations or watching progress. For downloads, you usually do not need this.

caffeinate -i make build

Keeps the Mac awake while the attached command runs. This is cleaner than remembering to press Ctrl+C later.

caffeinate -w 1234

Keeps the Mac awake until the process with ID 1234 exits.

When to be careful

caffeinate -d keeps the screen on. On a MacBook, that costs battery and can be unnecessarily bright. For background jobs, caffeinate -i or caffeinate -t 3600 is often enough.

If you only want to prevent a download from failing, let the display sleep and keep the system awake. That saves power and is usually the right behavior.

Rule of thumb

Use caffeinate when your Mac should stay awake briefly. Use -t when you want a fixed duration. Use -i with a command when the Mac should stay awake only for that job.

Sources

Selected references used to verify or support this tip.

Was this helpful?

Be the first to rate this tip!


WhatsApp