If you don't like the PC speaker (also known as system beep), you can easily disable it:
sudo modprobe -r pcspkr
Next, edit the /etc/modprobe.d/blacklist file (if it does not exist, create it):
sudo nano /etc/modprobe.d/blacklist
(Or you can issue gksudo gedit /etc/modprobe.d/blacklist or kdesu kate /etc/modprobe.d/blacklist for a graphical text editor - the first one for GNOME, which is the default desktop environment in Ubuntu, and the second for KDE, which is the default in Kubuntu.)
And add the following line:
The first command, sudo modprobe -r pcspkr will remove the pcspkr module from the kernel, so the beeps will stop immediately after issuing this command. The line blacklist pcspkr will prevent the kernel from loading this particular module when the computer boots up.
Now, the PC speaker functionality is disabled not only in the desktop environment, but also when in command-line.