Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need the option of ping which,If the net is disconnected, the pinging need to be stopped.Now if the net connection lost,It will wait and will continue after net came..

share|improve this question
up vote 4 down vote accepted

See man ping

-c count

Stop after sending count ECHO_REQUEST packets. With deadline option, ping waits for count ECHO_REPLY packets, until the time‐ out expires.

$ ping -c 5
PING ( 56(84) bytes of data.
64 bytes from ( icmp_req=1 ttl=53 time=18.4 ms
64 bytes from ( icmp_req=2 ttl=53 time=18.8 ms
64 bytes from ( icmp_req=3 ttl=53 time=15.1 ms
64 bytes from ( icmp_req=4 ttl=54 time=16.8 ms
64 bytes from ( icmp_req=5 ttl=54 time=19.6 ms

--- ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4005ms
rtt min/avg/max/mdev = 15.133/17.781/19.660/1.615 ms
share|improve this answer
That was a fast aswer. :) :)..thanks genius – Abdul Shajin May 23 '11 at 20:11

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.