This will only work if you have 10.3.5 I belive. It's basically just an apple script and if you use Doctor Q's method this should work in the command line or you can just make a script out of it. If you don't have 10.3.5 go with one of the other suggestions. A note about this is that it works like the mute button on the keyboard or the check box in system prefs, so if you unmute it, the volume will automatically go back to where it was.
set volume output muted 1
and to undo this it would be
set volume output muted 0
hope this helps