linux 终端发出哔声,关闭Linux下Shell终端嘟嘟声和vi中错误提醒的Beep音(zz)

很有用的东西

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

保存退出即可搞定

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值