Apple - Playing alert sounds from terminal

If you have "audible bell" enabled in your Terminal Settings under Advanced, BEL control characters will sound the default alert sound.

To try this, issue the echo command followed by control+v control+g. If you type it right, it will look like this:

$ echo ^G

and when you press return, the alert will sound.

(control+v is a shell escape for the immediately-following control character.)

The afplay command can also be used to play a specific sound file:

$ afplay /System/Library/Sounds/Funk.aiff 

Another option, with less modifier keys, is to use the command tput bel.


I like zigg's solution. In order to keep it short I did this:

In /Users/{username}/.bash_profile add a line

alias taskready='afplay /System/Library/Sounds/Hero.aiff'

Quit the terminal and open the terminal. Now you can use the shorthand command taskready.

You can choose from:

Basso.aiff  Frog.aiff   Hero.aiff   Pop.aiff    Submarine.aiff
Blow.aiff   Funk.aiff   Morse.aiff  Purr.aiff   Tink.aiff
Bottle.aiff Glass.aiff  Ping.aiff   Sosumi.aiff