# ping Command Reference ## What it does Tests network connectivity and measures round-trip time to a destination host using ICMP packets. ## Basic Usage ```bash ping google.com # Ping until stopped (Ctrl+C) ping -c 4 google.com # Send 4 packets then stop ping 8.8.8.8 # Ping using IP address ``` ## Common Arguments | Argument | Description | |----------|-------------| | `-c count` | Send specific number of packets | | `-i interval` | Wait interval seconds between packets | | `-t timeout` | Set timeout in seconds | | `-s size` | Set packet size in bytes | | `-q` | Quiet mode (summary only) | | `-v` | Verbose output | | `-n` | Don't resolve hostnames | ## Advanced Options ```bash # Flood ping (requires sudo) sudo ping -f google.com # Set packet size ping -s 1024 google.com # Ping with timestamp ping -D google.com # Ping specific interface ping -I en0 google.com ``` ## Timing Options | Argument | Description | |----------|-------------| | `-i 0.2` | Send packets every 0.2 seconds | | `-W 3000` | Wait 3 seconds for response | | `-t 10` | Stop after 10 seconds | ## Quick Commands ```bash # Basic connectivity test ping -c 3 google.com # Fast ping test ping -c 10 -i 0.2 8.8.8.8 # Quiet ping (just summary) ping -q -c 5 github.com # Large packet test ping -c 3 -s 1472 google.com ``` ## Reading Results ```bash 64 bytes from google.com (142.250.191.46): icmp_seq=1 ttl=115 time=12.3 ms ``` - `64 bytes` → Packet size received - `icmp_seq=1` → Sequence number - `ttl=115` → Time to live (hops remaining) - `time=12.3 ms` → Round-trip time ## Pro Tip > Use **Ctrl+C** to stop continuous ping and see statistics summary.