ping
networkLinux/Unix
The ping command is one of the most frequently used commands in Linux/Unix-like operating systems. ping Send ICMP ECHO_REQUEST to network hosts
Quick Reference
Command Name:
ping
Category:
network
Platform:
Linux/Unix
Basic Usage:
ping [options] [arguments]
Common Use Cases
Syntax
ping [options] destination
Options
Option | Description |
---|---|
-4 |
Use IPv4 only |
-6 |
Use IPv6 only |
-a |
Audible ping |
-A |
Adaptive ping |
-b |
Allow pinging a broadcast address |
-B |
Do not allow ping to change source address |
-c count |
Stop after sending count packets |
-D |
Print timestamp before each line |
-d |
Set SO_DEBUG option |
-f |
Flood ping (requires root privileges) |
-i interval |
Wait interval seconds between sending each packet |
-I interface |
Specify interface to use |
-l preload |
Send preload number of packages while waiting for responses |
-n |
Numeric output only, no hostname resolution |
-p pattern |
Up to 16 'pad' bytes to fill out the packet |
-q |
Quiet output - only show summary |
-R |
Record route |
-s packetsize |
Specify the number of data bytes to send |
-S sndbuf |
Set socket sndbuf |
-t ttl |
Set time to live |
-T timestamp |
Set special IP timestamp options |
-v |
Verbose output |
-w deadline |
Specify a timeout, in seconds, before ping exits |
-W timeout |
Time to wait for a response, in seconds |
Examples
How to Use These Examples
The examples below show common ways to use the ping
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
# Basic Examples Basic
ping google.com