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.

When we are using windows ping , it will show the failed pings. Does Ubuntu have similar function?

The failed ping is quite useful when debugging the network. How you guys solve this? Well, I only want simple solution, I don't want to get a long script.

share|improve this question
Can you provide a sample output or a screenshot to supplement the question? –  green7 Apr 6 '13 at 8:02
Are you looking or more detailed information than 5 packets transmitted, 0 received, 100% packet loss, time 4032ms (information like that is printed when ping terminates, whether by itself or by Ctrl+C)? Are you looking for separate data about each individual ping? –  Eliah Kagan Apr 6 '13 at 17:34
Linux is awesome and all of us here love it for many reasons but... hey sometimes Windows got it right and Linux got it wrong. Yes, even in basic CLI tools. Yes, even in basic networking CLI tools! If there is no easy way to get a message on screen when things go wrong then we must acknowledge it as "a feature we're missing". We certainly don't want to pretend it's something so complex that we can't figure out what is it exactly that the OP is asking (especially when it's a feature turned on by default in a few million boxes around us). –  ndemou Jan 17 at 18:41
I could have sworn that this feature was present in earlier linux ping. It's present in MacOS as well (which is built on top of unix). It's beyond me why it shouldn't be there. I have a line that works intermittent and to find out the lenght of the blackouts I need to sift through the output looking for jump, instead of having the lines clearly distinct. –  Silvio Levy Feb 9 at 19:59

3 Answers 3

Maybe ping -f is suitable for you. From ping manual:


Flood ping. For every ECHO_REQUEST sent a period ''.'' is printed, while for ever ECHO_REPLY received a backspace is printed. This provides a rapid display of how many packets are being dropped. If interval is not given, it sets interval to zero and outputs packets as fast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval.

For 1 echo_request every second it would look like ping -i 1 -f

share|improve this answer
Not sure it's a new feature or not, I could see the failed pings. –  王子1986 Apr 11 '13 at 14:15
Which option did you use to get the failed pings reported? What message are you getting for a failed ping? –  Daniel Yuste Aroca Apr 11 '13 at 18:46
While I just used ping the message is like this $ping PING ( 56(84) bytes of data. From icmp_seq=1 Destination Host Unreachable From icmp_seq=2 Destination Host Unreachable From icmp_seq=3 Destination Host Unreachable –  王子1986 Apr 12 '13 at 6:50
"Destination Host Unreachable" is not the same as a ping timeout –  ndemou Jan 17 at 17:31
ping -f is not the answer, because it doesn't leave a record. What is needed is one type of line for a successful ping and and a different for failure, so one can immediately tell (in a situation where service is intermittent) how often and how long the blackouts are. –  Silvio Levy Feb 9 at 20:14

Even with the -v option, ping don't do that. See this question. But if this is really important (or fun) for you, you can download the source, modify the code to include a suitable printf call. A good place to to that would be at the end of method 'send_probe' (line 619 on 12.10)...

First you get the source

apt-get source iputils
cd iputils*

Make edits

gedit ping.c

Build, and install generated package...

apt-get install libsysfs-dev
share|improve this answer
I would like to do this (and upvote this answer 10 times) but there must be something missing. I'm working under sudo -s. After editing ping.c, if I try "make" I get "fatal error: sys/capability.h: No such file". If I follow the next two lines in the answer (apt-get install and dpkg-...) I get no errors but I have no idea where the executable is placed. The old executable (/bin/ping) is still there -- I know it's old from the timestamp and because it doesn't behave any differently. –  Silvio Levy Feb 9 at 20:10
up vote -1 down vote accepted

Thanks for all the answers. It seems like the latest ubuntu ping can show the ping failed.

Thanks again.

share|improve this answer
No it doesn't (until 2015-Jan at least) "Destination Host Unreachable" is not the same as a ping timeout –  ndemou Jan 17 at 17:30

Your Answer


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.