メインコンテンツへ移動 / Skip to main content

Keep Your Mac Awake, Then Have It Tell You It Finishedcaffeinate and say (2026 Edition)

A refreshed guide to Mac's built-in caffeinate and say commands, with a full options cheat sheet — from preventing sleep to text-to-speech and scripting them into your automation workflow.

A Mac terminal window staying awake while a speech-bubble icon represents the say command
Technology
Published on: September 29, 2025
Updated on: October 23, 2026
Read time: 7 min
Author: Pochang Lab
Read time: 7 min

Introduction

Updated October 23, 2026: Rechecked on macOS Golden Gate (27), released in September 2026. Nothing has changed in how caffeinate and say work. This update corrects the description of say -o output formats to match the list on a real Mac, and adds the current settings name for adding voices, a way to confirm the effect with pmset, and the Shortcuts changes.

Hello everyone! Today I want to introduce two "hidden gem" commands that make your Mac more convenient — and a little more fun to use. The first is caffeinate. The second is say.

Both ship standard with current macOS, including macOS Golden Gate (27), released in September 2026 — no extra installs, no menu-bar utility app required. On a Mac running macOS 27.0.1, the options and man pages were the same as before.[3] Learning these two commands alone removes a surprising amount of everyday friction.

1. caffeinate — The Magic That Keeps Your Mac Awake

1-1. Purpose and Function

Mac automatically enters sleep mode after a period of inactivity — great for battery life, but inconvenient when you're:

  • Running a long download or build
  • Executing a server process or batch script
  • Displaying slides during a presentation or meeting
  • Streaming video or signage on an external display

That's where caffeinate comes in.[1] True to its name, it keeps your Mac awake for as long as the conditions you specify remain true.

1-2. Basic Usage

Open Terminal and type:

bash
caffeinate

That's it — your Mac won't sleep until you close the terminal or press Ctrl + C. Called with no arguments, caffeinate defaults to behavior equivalent to -i, preventing idle system sleep.

1-3. Mastering the Options

caffeinate has several flags you can combine to control precisely what — and for how long — stays awake.

OptionEffect
-dPrevents the display from sleeping
-iPrevents idle system sleep (default behavior)
-mPrevents idle disk sleep
-sPrevents system sleep (valid only while on AC power)
-uDeclares the user is active and wakes the display
-t <seconds>Keeps the assertion active for the given number of seconds
-w <PID>Waits until the process with the given PID exits

Some common combinations:

  • Prevent sleep for just 30 minutes
bash
  caffeinate -u -t 1800

-t takes seconds (1800 seconds = 30 minutes).

  • Prevent sleep only while a specific command runs
bash
  caffeinate -s curl -O https://example.com/bigfile.zip

Once curl finishes, sleep is automatically re-allowed. Because it wraps a process, this pattern works equally well for long builds or rsync transfers.

  • Wait for an already-running process to finish
bash
  caffeinate -w 1234

Prevents sleep until the process with PID 1234 exits — handy when pairing with a heavy job you already launched in the background.

  • Confirm that it is actually working
bash
  pmset -g assertions | grep caffeinate

While caffeinate is running, an assertion (a declaration that blocks sleep) named "caffeinate command-line tool" appears in the output.[4]

According to the man page, -u expires after about five seconds unless you add -t. When you pass a command for caffeinate to run, -t and -w are not used.

Cheat sheet illustrating caffeinate's main flags: -d, -i, -m, -s, -u, -t, -w

Figure 1: caffeinate's core flags at a glance — pick the display, system, or disk layer you want to keep awake.

1-4. When to Use It

  • Running large overnight downloads or backups
  • Keeping a Zoom, Google Meet, or Teams call visible without the screen dimming
  • Looping slides or video on an external display
  • Running CI builds or long npm/yarn tasks locally on your Mac

It's a small but powerful ally against the classic "oops, my Mac fell asleep" moment.

2. say — Let Your Mac Talk

2-1. Purpose and Function

Next up is the say command[2] — it literally makes your Mac talk. Originally part of macOS's accessibility features for visually impaired users, it also doubles as a fun tool for learning and for scripted notifications.

2-2. Basic Usage

Try this in Terminal:

bash
say "Hello, World!"

Your Mac speaks the phrase aloud. It handles Japanese just as naturally:

bash
say "おはようございます。今日も元気にいきましょう。"

2-3. Changing Voices and Saving to a File

You can add voices under System Settings → Accessibility → Read & Speak, using the info button next to “System voice” (as labeled in macOS 27).[5] List the voices already installed with say -v ?.

bash
say -v Kyoko "おはよう"
say -v Samantha "Good morning"
say -v "?"

Adjust speaking rate (words per minute) with -r:

bash
say -r 220 "This reads a little faster than normal"

You can also save speech to a file. AIFF is the default, and WAVE, CAF, m4a (AAC), FLAC, and other formats are also available. Supported formats vary by voice and OS version, so check the list with --file-format="?" below. MP3 is not in that list, and direct MP3 output is not supported. On macOS 27.0.1, using a .mp3 extension produced no error but left an unplayable file of only a few dozen bytes. If you need MP3, export to a supported format first, then convert with afconvert or ffmpeg.

bash
# Writes AIFF (the default)
say "This is a test recording" -o test.aiff

# Explicit format (m4af, caff, WAVE, etc. are also valid)
say "This is a test recording" -o test.m4a --file-format=m4af

# FLAC is also inferred from the extension
say "This is a test recording" -o test.flac

# List every writable format on your system
say -o /dev/null --file-format="?" "list"
Editorial illustration of the say command switching between Japanese and English voices and exporting to a file

Figure 2: say handles both Japanese and English speech. AIFF is the default output, and WAVE, CAF, m4a, FLAC, and more are available — converting to MP3 requires an extra step.

2-4. When to Use It

  • Language learning (hear English pronunciation read aloud)
  • Narration-style sound effects during a presentation
  • A spoken notification when a long-running task finishes
  • A quick sanity check for read-aloud content when a screen reader isn't available

Add say "Backup complete" to the end of an automated job, and it becomes a genuinely useful voice notification.

3. Advanced: Combining caffeinate and say

3-1. Completion Notifications for Long Jobs

Combine the two and you get an automation that "stays awake while working, and tells you out loud when it's done."

bash
caffeinate -s ./long_process.sh && say "Processing complete"
  • caffeinate -s prevents sleep
  • say announces completion by voice

It becomes a genuine "work buddy."

3-2. Wiring It Into a Shell Script

Add this pattern to your build or test wrapper scripts so you notice completion even when you've stepped away from the screen.

bash
#!/bin/bash
set -e
caffeinate -dims &
CAFFEINATE_PID=$!

npm run build
npm test

kill "$CAFFEINATE_PID" 2>/dev/null
say "Build and tests are complete"

caffeinate -dims chains flags together to block display, system, and disk idle sleep at once. It runs in the background and gets killed once the work finishes.

Diagram of an automation flow: caffeinate blocks sleep during a build, then say announces completion

Figure 3: caffeinate blocks sleep, then say announces completion by voice — together they form a reliable work buddy.

4. A Few More Built-In Commands Worth Knowing

Beyond caffeinate and say, macOS ships with a handful of other commands that are easy to miss but genuinely useful alongside them.

  • pbcopy / pbpaste: Pipe standard input/output to and from the clipboard. cat file.txt | pbcopy copies a file's contents directly.
  • open -a "AppName": Open any app, file, or URL from Terminal. open . to reveal the current directory in Finder is a classic.
  • screencapture -T 5 shot.png: Takes a screenshot after a 5-second delay. Add -i for interactive selection or -c to copy straight to the clipboard.
  • shortcuts run "Shortcut Name": Run a saved Shortcuts (the successor to Automator) workflow with a single line from Terminal. In macOS 27, the four subcommands — run, list, view, and sign — are unchanged. The app itself gained the ability to create shortcuts from a natural-language description (Apple Intelligence required) and an automation triggered when a screenshot is saved, which also works on the Mac.[6]

Quick summary: knowing caffeinate, say, pbcopy/pbpaste, open, screencapture, and shortcuts run together removes a lot of situations where you'd otherwise reach for the mouse.

Conclusion

Today we covered a few genuinely useful commands that ship standard with Mac but are surprisingly unknown.

  1. caffeinate: Keeps your Mac awake — great for long tasks and meetings
  2. say: Makes your Mac talk — useful for learning, notifications, and presentation flair
  3. Combining both: Sleep prevention plus a spoken completion notice makes a solid "work buddy"
  4. Neighboring commands: pbcopy/open/screencapture/shortcuts run round out the toolkit

Every one of these is a small trick that makes daily life on the Mac a bit smoother. Open Terminal and give them a try.

References

  1. [1]macOS man page, caffeinate(8) — run man caffeinate in Terminal. ↩
  2. [2]macOS man page, say(1) — run man say in Terminal. ↩
  3. [3]The Eclectic Light Company: Apple has released macOS Golden Gate 27.0 (September 14, 2026). Command behavior was checked on macOS 27.0.1 by running man caffeinate, man say, and say --file-format="?" (October 23, 2026). ↩
  4. [4]macOS man page, pmset(1) — run man pmset in Terminal. Output checked on macOS 27.0.1. ↩
  5. [5]Apple Support: Change the voice your Mac uses to speak text. ↩
  6. [6]Apple Support: New in iOS, iPadOS, macOS, watchOS, and visionOS 27 (Shortcuts). Subcommands checked on macOS 27.0.1 with shortcuts help. ↩

Related Articles

August 4, 2026

Windows Features Already on Your PC: PowerToys, winget, and God Mode (2026 Edition)

PowerToys, winget, God Mode, Problem Steps Recorder, Efficiency Mode, and more — a practical tour of genuinely useful Windows 11 features that are built in or officially free from Microsoft, yet surprisingly few people know about.

TechnologyRead more
September 4, 2025

Windows vs Mac: Complete Guide to Differences, History, and Market Share

A beginner-friendly guide to the differences between Windows and Mac, covering historical background, current market share, and user demographics.

TechnologyRead more
October 29, 2026

Fable 5.1 or Opus 5.5 in Claude Code? A Decision Matrix Built on Evidence, User Reports, and Effort

Compare Fable 5.1 and Opus 5.5 in Claude Code using official and independent evaluations, user reports, pricing, effort, and Ultracode. Includes a task matrix and a practical routing skill design.

TechnologyRead more
October 22, 2026

What Makes Gemini 4 Argon Different? — GPT-6, Claude Fable 5.1, and Opus 5.5 Compared

Compare Gemini 4 Argon with GPT-6.1 Sol, GPT-6 Astra, and Claude Fable 5.1, Opus/Sonnet 5.5: shared context, long output, video and audio input, introductory pricing, and practical choices for coding, analysis, and everyday work.

TechnologyRead more
October 22, 2026

PHP2Shell Response Guide — AWS, Legacy PHP, and Vulnerability Response in the AI Era

A primary-source guide to PHP2Shell disclosed on October 21, 2026, updated the night of October 22: exploitation attempts before disclosure, Japan’s government response and preventive outages worldwide, Amazon Linux fixes, AWS WAF limits, legacy backports, deployment verification, and AI-assisted discovery.

TechnologyRead more

From the Pocho Lab

Try this next