2025-03-14 21:59:59 -06:00
|
|
|
# caffeinate
|
|
|
|
|
|
|
|
|
|
> Prevent macOS from sleeping.
|
|
|
|
|
> More information: <https://keith.github.io/xcode-man-pages/caffeinate.8.html>.
|
|
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
- Prevent the display from sleeping:
|
|
|
|
|
|
|
|
|
|
`caffeinate -d`
|
|
|
|
|
|
2025-03-14 21:59:59 -06:00
|
|
|
- Prevent from sleeping for 1 hour (3600 seconds):
|
|
|
|
|
|
|
|
|
|
`caffeinate -u -t {{3600}}`
|
|
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
- Fork a process, exec "make" in it, and prevent sleep as long as that process is running:
|
2025-03-14 21:59:59 -06:00
|
|
|
|
2025-07-24 22:27:13 -06:00
|
|
|
`caffeinate -i make`
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
- Prevent from sleeping until a process with the specified PID completes:
|
|
|
|
|
|
|
|
|
|
`caffeinate -w {{pid}}`
|
|
|
|
|
|
2025-03-19 19:23:44 -06:00
|
|
|
- Prevent disk from sleeping (use `<Ctrl c>` to exit):
|
2025-03-14 21:59:59 -06:00
|
|
|
|
|
|
|
|
`caffeinate -m`
|