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.
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
04Undo
Undo
$ osascript -e "set volume output muted false"05Sources
- osascript — execute AppleScript and JavaScript (macOS)Evidence: Documents running AppleScript one-liners via -e from the shell.
- AppleScript Language Guide — Commands ReferenceEvidence: AppleScript language guide documents the set volume command with output muted and output volume properties.
Last verified: 2026-09-17 · Category: Media