How to Disable Terminal Beep Sound in Linux (Bash/Ubuntu)


2 views

The audible bell in Linux terminals (often called "beep" or "audible bell") is a legacy feature from early computing days. It serves as an audio feedback mechanism for various events:

  • Attempting to backspace at the start of line
  • Failed tab completion
  • Invalid commands in some shells
  • Reaching the end of scrollback buffer

The most reliable way to disable this system-wide is by editing your bash configuration files. Here's how:


# Edit or create ~/.inputrc
echo "set bell-style none" >> ~/.inputrc

# For system-wide changes (requires sudo)
sudo sh -c 'echo "set bell-style none" >> /etc/inputrc'

Alternatively, you can directly modify your .bashrc:


# Add to ~/.bashrc
setterm -blength 0

For temporary disabling during your current terminal session:


# Disables the PC speaker entirely
xset -b

# Alternative method using setterm
setterm -blength 0

If you're using GNOME Terminal:


gsettings set org.gnome.desktop.wm.preferences audible-bell false

For Konsole (KDE's terminal):


kwriteconfig5 --file konsolerc --group Notification --key EnableBell false

To verify your current configuration:


# Check inputrc settings
grep "bell-style" /etc/inputrc ~/.inputrc

# Check X11 bell settings
xset q | grep -A 1 "Bell"

If the beep persists after trying these solutions:

  1. Check for multiple configuration files that might override settings
  2. Verify no terminal emulator-specific settings are enabled
  3. Consider hardware-specific solutions (some BIOS have beep controls)

Remember to restart your terminal or source your configuration files (source ~/.bashrc) after making changes.


The audible bell in Linux terminals (also known as the "beep") is generated through the terminal emulator's interpretation of ASCII BEL character (0x07). This occurs in multiple scenarios:

  • Attempting backspace at line start (^H)
  • Failed tab completion
  • Console error messages
  • Explicit echo -e "\a" commands

For Ubuntu/Debian systems, blacklist the PC speaker module:

echo "blacklist pcspkr" | sudo tee /etc/modprobe.d/nobeep.conf
sudo update-initramfs -u

For Arch Linux users:

echo "blacklist pcspkr" >> /etc/modprobe.d/blacklist.conf

Bash Configuration

Add to your ~/.bashrc:

# Disable audible bell
set bell-style none
# Disable visual bell (flashing)
set bell-style visible

XTerm Configuration

Create or modify ~/.Xresources:

XTerm*visualBell: true
XTerm*bellIsUrgent: false

Then run:

xrdb -merge ~/.Xresources

For immediate effect without restarting terminal:

xset -b  # Disables X server bell
xset b off  # Alternative method

Most modern terminal emulators provide GUI options:

  • GNOME Terminal: Edit → Preferences → Current Profile → Text → Uncheck "Terminal bell"
  • Konsole: Settings → Configure Notifications → System Bell → Disable
  • Alacritty: Add to config: bell: { audible: false }

Test your configuration with:

echo -e "\a"  # Should produce no sound
printf "\a"   # Alternative test

To check current X server bell status:

xset q | grep -A 1 "bell"