How do I turn off the beep in the terminal in Linux?
Solution 1:
Easiest fix: put
set prefer-visible-bell on
in your ~/.inputrc
.
This however will only work for applications using the readline library (this includes Bash). Other applications may still decide to beep at you.
If you want to disable all beeping, you will have to do it in the terminal. How to do this depends on your terminal. In xterm
it's option -vb
(also works in many other terminals, e.g. in rxvt). Most graphical terminals have a config option for this.
Also see the Visible bell mini-Howto for all the dirty details.
Solution 2:
As the pc speaker is annoying altogether (at least, I think it is), I just go
modprobe -r pcspkr
and add it to /etc/modprobe.d/blacklist.conf like this:
blacklist pcspkr
No more beeps. Ever.
Does not work for bells through /dev/snd/*, obviously
Solution 3:
$ setterm -blength 0
You'll want to add this to your Bash profile.
Solution 4:
from cybercity:
- Open Gnome terminal
- Click on Settings > Preferences > Silence Terminal Bell
Solution 5:
In addition to the setterm
and GNOME settings solutions already suggested there are the following:
If running X, open an xterm
and enter xset b off
.
To disable system bell in Bash startup edit ~/.inputrc
or /etc/inputrc
and add the line set bell-style none
or set bell-style visual
if you want a screen flash.
There's a good article on this here.