Prevent your Mac from sleeping for one hour
Temporarily stop macOS from sleeping without changing Energy settings.
Run the command below. Your Mac stays awake for 3600 seconds (1 hour) and sleeps normally afterwards. Press Ctrl+C to stop early.
01Command
Command
$ caffeinate -t 360002What it does
caffeinate creates a temporary power assertion that keeps macOS awake while it runs — the same mechanism used by long installs and Time Machine. The display may still dim per your settings; only system sleep is prevented. Change 3600 to any number of seconds you need.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- caffeinate — prevent the system from sleepingEvidence: caffeinate -t <seconds> creates assertions preventing sleep for the given duration.
Last verified: 2025-11-12 · Category: System & Settings