Keep Your Mac Awake with caffeinate

caffeinate holds sleep off while a command runs, or for a fixed number of seconds.

macOSsleepTerminalPower & SleepLow risk
Run `caffeinate -d -t 3600` to keep the display awake for one hour, or `caffeinate -i <command>` while a specific job runs.

01Command

Command
$ caffeinate -d -t 3600

02What it does

caffeinate creates a power assertion — the same mechanism that keeps a Mac awake during a system update. The flags target different sleep types: -d keeps the screen on, -i blocks idle system sleep, -m guards disk sleep, and -s keeps the whole system awake on desktops. With a command after the flags, the Mac stays awake until that command finishes, which is ideal for `caffeinate -i rsync …` style jobs. When the command exits or the timer ends, normal sleep rules resume — nothing is changed permanently.

03Risk

RiskLow risk
RequirementsWorks only while the command runs; press Ctrl-C to end early. Lid-closed sleep on laptops needs an external power source.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-18 · Category: System & Settings

06Related solutions