Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The ping manual says that ping -a will generate audible pings, but when I try this no sound is made.

What am I doing wrong?

share|improve this question

3 Answers 3

up vote 5 down vote accepted

From looking at the source, ping produces a bell by printing the ASCII bell char '\a', which is doing nothing, probably because the system beep is disabled.

You can manually try to produce the bell with:

echo -e "\a"
share|improve this answer
    
That's helpful. I'll troubleshoot the bell. –  ændrük Dec 6 '10 at 7:11
    
This is likely a Compiz bug. If you disable Desktop Effects, you will probably hear the pings. –  Dylan McCall Jan 20 '11 at 7:21
1  
Yep, here is your bug report: bugs.launchpad.net/ubuntu/+source/compiz/+bug/537703 –  Dylan McCall Jan 20 '11 at 7:31
1  
No ping or audio from the echo command on CrunchBang Linux (OpenBox) with no compiz. –  SabreWolfy Dec 7 '11 at 13:41

gnome-terminal or compiz "eats" the sound and this is a reported bug, so it won't work in the graphical interface. (see this bug report, thanks to Dylan McCall comment for the URL).

If you really need the functionality, you could run your ping from a physical console (Ctrl+Alt+F1). But don't forget:

sudo modprobe pcspkr

As module pcspkr isn't loaded at boot time and actually drives the old PC speaker you should have in your computer.

You can add it to /etc/modules if you think you'll need it at a regular basis as this will have the effect to tell the system to load it at boot time.

share|improve this answer

Because the question is not specified for Unity only, I'll make a little hint about KDEs Konsole. You just should specify a sound for a "Bell in Visible Session" which is under Settings -> Configure Notifications. For example I'm using sounds from /usr/share/sounds/ section. I don't remember is there such an option in Ubuntu's Unity terminal.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.