man.lsPlain-English help for Unix commands

ping Test whether a host is reachable

Sends small test packets (ICMP echo requests) to a host and reports how long each reply takes. Use it to check that a machine is up and the network path works. On Linux and macOS it keeps going until you stop it, so give it a count with -c.

Synopsis

ping -c COUNT [OPTION]... host

Common options

Option or formWhat it does
-c COUNTStop after sending COUNT packets. Without it, ping runs until you press Ctrl+C on Linux and macOS
-i SECONDSWait SECONDS between packets. The default is one second
-t SECONDSOn macOS, give up after SECONDS in total. On Linux, -t sets the TTL instead
-W MSHow long to wait for each reply. On macOS the value is in milliseconds. On Linux (iputils) it is in seconds
-s SIZESet the size of the data in each packet, in bytes
-qQuiet output: show only the summary at the end
-nShow numeric addresses only, without looking up names

Examples

Send four packets, then stop
ping -c 4 example.com
Check a documentation address, one packet
ping -c 1 192.0.2.10
Send packets every two seconds
ping -c 5 -i 2 example.com
Show only the summary
ping -c 10 -q example.com
Skip name lookups
ping -c 3 -n 192.0.2.10

Notes

See also

Last reviewed 2026-10-07.