ping command
Check whether a host is reachable and measure latency.
- Networking
- Package iputils-ping
- 6 options · 5 examples
Syntax
ping [options] hostProvided by the iputils-ping package. Run man ping for the full manual.
Common options
| Option | What it does |
|---|---|
-c N | Send N packets and stop |
-i SEC | Seconds between packets |
-W SEC | Wait time for each reply |
-s SIZE | Packet size in bytes |
-4 / -6 | Force IPv4 or IPv6 |
-q | Only print the summary |
Examples
Ping until you press Ctrl+C
ping example.comSend 4 packets
ping -c 4 8.8.8.8Quiet summary only
ping -c 10 -q example.comIPv6
ping -6 example.comCheck in a script
ping -c 1 -W 2 192.0.2.10 > /dev/null && echo up || echo down
No example matches. Check the options table or search the guides.
ping guides
- (Resolved) “-bash: ping: command not found” Error in Docker Shell Scripting · Updated Apr 2025
- Understand Ping Command Linux Commands · Updated Apr 2025
- Check Network Connectivity using Ping Command in Shell Scripts Linux Commands · Updated Apr 2025
- Ping Command in Linux with Practical Examples Linux Commands · Updated Apr 2025
- How to Block Ping (ICMP) Responses in Linux Security · Updated Apr 2025
