Mute or Set Volume from the Mac Command Line

AppleScript's set volume command is the only built-in way to mute or change volume from Terminal and scripts.

macOSosascriptautomationvolumeLow risk
Run `osascript -e "set volume output muted true"` to mute; use false to unmute, or set volume output volume 50 for a percentage.

01Command

Command
$ osascript -e "set volume output muted true"

02What it does

macOS has no volume CLI, so the standard trick is a one-line AppleScript via osascript. The set volume command accepts output muted true/false, output volume 0–100, and input volume for the microphone. Note the asymmetry: output volume is a 0–100 percentage while input volume is 0–255, which trips up scripts constantly. Combine with cron or Shortcuts to auto-mute at set times.

03Risk

RiskLow risk
RequirementsBuilt-in on macOS.

04Undo

Undo
$ osascript -e "set volume output muted false"

05Sources

Last verified: 2026-09-17 · Category: Media