~2 min read • Updated Jul 20, 2025
1. What Is Ping?
The ping command (short for “Packet InterNet Groper”) is used to test connectivity to a specified IP address or hostname by sending ICMP Echo Requests. It helps diagnose network outages, latency, and routing problems.
2. Basic Syntax
ping destination ping 8.8.8.8 ping www.google.com
By default, ping continues indefinitely until interrupted (e.g., with Ctrl+C).
3. Important Ping Switches
| Option | Description | Example |
|---|---|---|
| -c | Number of packets to send | ping -c 4 google.com |
| -i | Interval between requests (in seconds) | ping -i 2 8.8.8.8 |
| -W | Timeout for replies (in seconds) | ping -W 3 google.com |
| -t | Set TTL (Time To Live) value | ping -t 128 192.168.1.1 |
| -s | Size of each packet in bytes | ping -s 1000 google.com |
| -q | Quiet output (summary only) | ping -c 4 -q 8.8.8.8 |
| -D | Print timestamp with each line | ping -D -c 2 google.com |
| -f | Flood ping (requires root) | sudo ping -f localhost |
| -n | Do not resolve hostnames | ping -n 8.8.8.8 |
| -v | Verbose output | ping -v google.com |
4. Sample Output Explanation
64 bytes from 8.8.8.8: icmp_seq=1 ttl=117 time=20.3 ms
- icmp_seq: Sequence number of the packet
- ttl: Time-to-live value (hop limit)
- time: Round-trip latency (in milliseconds)
Final summary:
--- google.com ping statistics --- 4 packets transmitted, 4 received, 0% packet loss, time 3002ms rtt min/avg/max/mdev = 12.034/14.245/17.672/1.902 ms
5. Use Cases
- Check server availability:
ping 192.168.0.1 - Verify DNS resolution:
ping google.com - Measure connection latency:
ping -c 10 8.8.8.8 - Test local speed:
sudo ping -f localhost - Evaluate large packet handling:
ping -s 1200 -c 5 www.google.com
6. Limitations and Precautions
- Some systems or firewalls block ICMP packets
- Ping may be disabled by network policy
-f(flood) ping should be used with caution—only for trusted testing
7. Conclusion
The ping command is an essential diagnostic tool in Linux networking. Understanding its switches, interpreting output, and knowing its limits equip users to troubleshoot and monitor networks efficiently.
Written & researched by Dr. Shahin Siami