很有用的东西
Q. This beep sound is annoying under Linux, how do I disable it
forever?
A. To be frank there are many ways exists - to turn off terminal
beep. Use any one of the following method as per your
requirements.
If you are using Gnome terminal
a) Open Gnome terminal
b) Click on Settings > Preferences >
Silence Terminal Bell
Or Click on General Tab -> General
-> Un-Check Terminal bell option
If you are using xterm
Open ~/.xsession file (i.e. /home/you/.xession)
$ cd
$ vi .xessionAppend following line
xset b off
Save and close the file.
If you are using bash
Open you ~/.inputrc file (i.e. /home/you/.inputrc file
$ cd
$ vi .inputrcAppend following line:
set bell-style none
Save and close the file.
If you just want to turn off beep for VIM text editor:
Open vim config file ~/.vimrc (i.e. /home/you/.vimrc)
$ cd
$ Vi .vimrcAppend following line
set vb
Save and close the file.
If you are using Ubuntu Linux
a) Click on Applications > Accessories
> Terminal
b) Now click on Edit Menu > Current Profile
c) Click on General Tab > General >
Remove check box (Terminal bell)
引用自:http://www.cyberciti.biz/faq/how-to-linux-disable-or-turn-off-beep-sound-for-terminal/
我自己尝试并且成功关闭终端的方法:
在 shell 里面,你可以按下 crtl-g 来测试一下这个嘟嘟声是否已经去掉
在终端(无X11)可以:
setterm -blength 0
#alternatively you can change the frequency of the beep to a very
low value:
setterm -bfreq 10
而在 X11 下面(不管是 KDE、Gnome、XFCE 或者……) 你可以:
xset b off
对 Bash:
# has to go into /etc/inputrc or .inputrc
# It will not work in a .bashrc file!
set bell-style none
对 Tcsh:
# put this into your .tcshrc file
# just tab completion beep off:
set matchbeep = never
# any beep off:
set nobeep = 1
我自己尝试并且成功关闭了vi中的beep声的方法:
在~/.vimrc里面添加一行:
set vb
保存退出即可搞定