7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

LinuxのBeep音を無効化する

Last updated at Posted at 2016-01-01

ターミナルのBeep音が気になるので鳴らないようにしたい。

環境

  • debian 5.0.10

Beep音を鳴らしているのは誰か

pcspkr(Beep音のドライバ)
pcspkrが無ければ、Beep音は鳴らなくなる。

一時的にBeep音を無効化

確認

# lsmod | grep pcspkr
pcspkr                  2432  0

pcspkrがある。

pcspkrを削除

# modprobe -r pcspkr
#

modprobe -r pcspkrでモジュールを削除する。
以下manより-rオプションの抜粋。

-r --remove
         This option causes modprobe to remove, rather than insert a module.  If the modules it depends on are also unused, modprobe will try to remove them, too.  Unlike insertion,
         more than one module can be specified on the command line (it does not make sense to specify module parameters when removing modules).

         There is usually no reason to remove modules, but some buggy modules require it.  Your kernel may not support removal of modules.

再確認

# lsmod | grep pcspkr
#

pcskrが消えた。
ここまでだと再起動すると、またBeep音が鳴る。

永続的にBeep音を無効化

# echo blacklist pcspkr >> /etc/modprobe.d/blacklist

Bashの場合

set bell-style none

.bash_profile 等に記載しておくことで抑制できる。

manからの抜粋
bell-style (audible)
      Controls what happens when readline wants to ring the terminal bell.  If set to none, readline never rings the bell.  If set to visible,  readline  uses  a
      visible bell if one is available.  If set to audible, readline attempts to ring the terminal's bell.
7
8
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?