Test network connectivity and measure round-trip latency.
low risk
ping sends ICMP echo requests to test if a host is reachable and measure round-trip time. On Linux, ping runs indefinitely by default (unlike macOS) — use -c to limit packets. The -i flag controls interval, -s sets packet size for bandwidth testing.
| Flag | Meaning |
|---|---|
-c --count | Number of packets to send |
-i --interval | Seconds between packets |
-t --ttl | Set Time To Live |
-s --size | Packet size in bytes |
-W --timeout | Seconds to wait for reply |
ping -c 4 8.8.8.8Send 4 packets to Google DNS · explain & risk-check →ping -c 100 -i 0.2 10.0.0.1 | tail -2Fast flood test and show statistics only · explain & risk-check →ping -c 1 -W 2 host && echo UP || echo DOWNBinary up/down check in scripts · explain & risk-check →Use `ping -c 100 -q host` for a quick latency baseline — the -q flag shows only statistics. Compare min/avg/max/mdev to identify jitter vs consistent latency issues.
Reference text is hand-written and may be incomplete — check man ping for your version. Test destructive commands on a non-production system first.