# macOS: use caffeinate to keep your computer on

DevFeed: [macOS: use caffeinate to keep your computer on](<https://devfeed.tech/articles/macos-use-caffeinate-to-keep-your-computer-on-55645.md>)

Original publisher: [Read original article](<https://adamj.eu/tech/2026/09/20/macos-caffeinate/>)

Author: Adam Johnson

Published: 2026-09-19T23:00:00Z

Content type: tutorial

Language: en

Sources: [Adam Johnson](<https://devfeed.tech/sources/adam-johnson.md>)

Topics: [macOS](<https://devfeed.tech/topics/macos.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Process](<https://devfeed.tech/topics/process.md>), [long-running](<https://devfeed.tech/topics/long-running.md>)

Tags: [command](<https://devfeed.tech/tags/command.md>), [commandline](<https://devfeed.tech/tags/commandline.md>), [computer](<https://devfeed.tech/tags/computer.md>), [job](<https://devfeed.tech/tags/job.md>), [long-running](<https://devfeed.tech/tags/long-running.md>), [macos](<https://devfeed.tech/tags/macos.md>), [process](<https://devfeed.tech/tags/process.md>), [screen](<https://devfeed.tech/tags/screen.md>), [terminal](<https://devfeed.tech/tags/terminal.md>)

## AI overview

A practical guide to using macOS's built-in caffeinate command to keep a Mac awake while a long-running job executes. It covers running commands under caffeinate, keeping the system awake until interruption or a process exits, preventing display sleep, and limitations such as closing the lid.

## Source excerpt

If you're starting a long job on your Apple Macintosh Computer and wandering off for a coffee, the machine may go to sleep before it finishes due to inactivity. To prevent that from happening, also give your computer a boost with the caffeinate command, a macOS built-in since 2012 ...