Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

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 am pinging a remote IP. I know very little about the Ping command. When I ping the IP, it keeps going and going... I am not using the -t option.

Me$ ping
PING ( 56 data bytes
64 bytes from icmp_seq=0 ttl=62 time=3.378 ms
64 bytes from icmp_seq=1 ttl=62 time=3.825 ms
64 bytes from icmp_seq=2 ttl=62 time=4.882 ms
64 bytes from icmp_seq=3 ttl=62 time=1.822 ms
64 bytes from icmp_seq=4 ttl=62 time=4.572 ms
64 bytes from icmp_seq=290 ttl=62 time=3.273 ms

Does that mean it is successfully pinging the IP? Or that it is trying and failing and trying again? How do I get it to stop?

share|improve this question
Yes, it is successfully pinging. You can stop it with Ctrl-C. – Faheem Mitha Nov 3 '13 at 17:49
Unix-likes ping doesn't stop like windows does by default. – Gilles Quenot Nov 3 '13 at 18:08
@sputnick yeah that was what was confusing me – bernie2436 Nov 3 '13 at 18:11
See how you can control it in my answer! – slm Nov 3 '13 at 18:13
up vote 9 down vote accepted

That's how the ping command works. You can control it using the count switch, -c.


$ ping -c 2 skinner
PING skinner.bubba.net ( 56(84) bytes of data.
64 bytes from skinner.bubba.net ( icmp_req=1 ttl=64 time=1.00 ms
64 bytes from skinner.bubba.net ( icmp_req=2 ttl=64 time=1.13 ms

--- skinner.bubba.net ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1002ms
rtt min/avg/max/mdev = 1.001/1.069/1.138/0.075 ms

Breakdown of output

Lines like this mean that it is successfully pinging the other host:

64 bytes from skinner.bubba.net ( icmp_req=2 ttl=64 time=1.13 ms

These lines show detalis about each "ping" as it occurs between your host and the host you're atempting to ping.

6th column

The column that contains this value, icmp_req=2 is telling you which ICMP packet this is regarding. The ping command manufactures network packets. There are many types, you've probably heard of TCP or perhaps UDP packets. Another type is ICMP. ICMP is similar to SMS in cell phone networks. It's primary purpose is for command and control over the network.

7th column

The 3rd column that's interesting is the TTL=64. TTL - "aka. Time to Live", mean that the packet will only transverse through at most 64 nodes before timing out. So if the system is more than 64 "hops" away from your system, you can't ping it, unless you increase the TTL.

8th column

This column shows how long, in time, the ping took to occur (in milliseconds). This would be the column that looks like this: time=1.13 ms.

The other columns are fairly self explanatory.

Ping versions

Different ping commands are implemented differently across the various Unixes. So you need to pay attention to the version.

$ ping -V
ping utility, iputils-sss20100418

I'm on a Fedora 14, Linux system.

share|improve this answer

slm's answer is great, but if you just want to quickly check whether a host is alive (and reachable, and responding to ping) then you can use fping instead of ping. It pings the host(s), and waits a short time for a response. fping's exit code reports success or failure.


cas@ganesh:~$ fping kali
kali is alive
cas@ganesh:~$ echo $?

cas@ganesh:~$ fping durga 
ICMP Host Unreachable from 203.xx.xxx.1 for ICMP Echo sent to durga (203.xx.xxx.14)
ICMP Host Unreachable from 203.xx.xxx.1 for ICMP Echo sent to durga (203.xx.xxx.14)
ICMP Host Unreachable from 203.xx.xxx.1 for ICMP Echo sent to durga (203.xx.xxx.14)
ICMP Host Unreachable from 203.xx.xxx.1 for ICMP Echo sent to durga (203.xx.xxx.14)
durga is unreachable
cas@ganesh:~$ echo $?

The 'ICMP Host Unreachable' messages can be discarded by redirecting stderr to /dev/null. For example:

cas@ganesh:~$ fping durga 2>/dev/null 
durga is unreachable
share|improve this answer

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.