How do you mute the sound system from the command line?

share|improve this question
    
Works perfectly with the i3 window manager. Thanks a lot! – user315729 Aug 14 '14 at 18:42
up vote 55 down vote accepted

Assuming you're using ALSA driver, run:

amixer set Master mute   
amixer set Master unmute

Or, you can just use:

amixer set Master toggle

to toggle mute on and off.

share|improve this answer
5  
for me / my system (precise), this only goes one way: off / mute. Neither toggle nor unmute bring the music back on. Any ideas as to why?? – nutty about natty May 8 '12 at 13:12
1  
1  
This solution is for pure Alsa. For Alsa with pulseaudio, use the command from Tim's answer. Or don't touch the command and instead configure Alsa as in this answer. Else, @nutty about natty's problem of not being able to unmute results. – tanius Feb 17 '16 at 1:32
    
on Ubuntu Server 14.04 "Master" was not available as a simple control. I used "Speaker" in its place. I found the substitution by running sudo amixer and finding the line in the output that matched Simple mixer control 'Speaker',0 – brycemcd Oct 2 '16 at 20:11

This worked for me when others didn't:

amixer -q -D pulse sset Master toggle

This is from the link in nutty about natty's comment to the first answer:

share|improve this answer
1  
I also just checked, it works on 14.04 too. – Tim May 30 '14 at 8:59
1  
did it :) - kubuntu here (Ubuntu 14.04.2 LTS). thx. – hakre Jul 2 '15 at 18:28
1  
This -D pulse option is needed when Alsa is used with pulseaudio (and since the question is tagged pulseaudio, this should be the accepted answer). For more details about this solution, see here and here on askubuntu. – tanius Feb 17 '16 at 1:23
    
Note: The accepted answer by @goric doesn't work when headphones or earphones are plugged in, use this. – Bharadwaj Raju May 27 '16 at 12:34
    
Or, less ambiguously than "toggle", you can use amixer -q -D pulse sset Master mute and amixer -q -D pulse sset Master unmute. Works great on Ubuntu 16.04 – CPBL Jun 30 '16 at 13:00

In my setup sometimes amixer unmute fails for some reason. Therefore I'm using pactl in my scripts:

to mute:

pactl set-sink-mute 0 1

and unmute:

pactl set-sink-mute 0 0

Tested on Ubuntu 12.10.

share|improve this answer
    
Still works in Ubuntu 15.10. – tanius Feb 17 '16 at 0:38
    
LIkely, this is the proper way to perform the operation on modern Ubuntu versions. Works on 16.04 (amixer doesn't). – Marcus Feb 25 '17 at 19:42

On the terminal type this to mute

amixer set Master mute

type

amixer set Master unmute

Tested on my Ubuntu 10.10.

PS: +1 for interesting question.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.