TIL about caffeinate
a built-in macOS command-line tool that prevents your Mac from sleeping.
Here are some common usages
caffeinate -d
- prevents the display from sleeping, but allows other parts of the system to sleep.caffeinate -s
- prevents sleep when there’s an active user session (helpful in remote work or screen sharing).caffeinate -dt 600
- prevents display sleep for 10 minutes.caffeinate -i script.sh
- keeps system awake only while the script runs, then exits.
via Scott Knight