Change the System Volume from the Command Line in Mac OS X

There are several ways to go about changing the volume on your Mac, but did you know you can use the command line? I’m a big command line junkie so the more things I can do from the Terminal the better.

If you want to adjust your system volume level directly from the command line, you can do so with the ‘osascript’ command, which is basically a terminal front-end to AppleScript and all that it can do.

For the purposes of changing system volume via Terminal in just about every single version of Mac OS X ever to exist, here are the necessary commands:

1. Like Andrew, I didn’t need sudo permissions for this. 10.4. YMMV.
2. I found it fun to combine this with a few other commands.
a. SSH into a coworker’s box.
b. # osascript -e “set Volume 10″
c. # say -v Whisper “Why are you checking personal email on company time?”

well if you read the man pages: Enter one line of a script. if -e is given, osascript will not look for a filename in the argument list.
it is executing a script, set volume 10, but a one liner, and you have to put the proper qoutation marks.

Can you go past maximum volume with this? It drives my crazy when I try to watch a movie while I wait around the airport and have to boot into windows to hear what’s going on (Windows plays sound louder for some reason)

I used this to make a little script to easily change the volume. Using an admin account on OS X Mavericks, I don’t seem to need to use sudo to use osascript. If you just copy and paste this into your terminal it should install a command called volume, which you can use like “volume 10″, where the number is between 0 and 100, inclusive, and can have a decimal point: