Diagnose 192.0.2.1 with iputils ping.
End ping five seconds after starting regardless of replies.
Which command is appropriate?
For iputils ping, -w DEADLINE limits the total runtime independently of request count and individual response waits.
Detailed explanation
ping -w 5 192.0.2.1Correct. -w 5 sets a five-second overall deadline.
ping -i 5 192.0.2.1Incorrect. -i sets the interval between echo requests.
ping -s 5 192.0.2.1Incorrect. -s sets the payload size.
ping -c 5 192.0.2.1Incorrect. -c 5 limits count, not elapsed time.
Try it yourself
An example you can run in a temporary verification environment.
ping -h 2>&1 | grep -E -- '-w.*deadline|-W.*timeout' | head -n 2Expected result
-wがdeadline、-Wがtimeoutであることを示すhelp行Key points
- -w is the total deadline
- -W is per-response wait
- -c is request count
Notes
- Environment: iputils ping help / パケット送信なし
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Interface counters
Kernel-maintained counts of packets, errors, and drops at an interface.
Socket
A local or remote endpoint associated with a transport protocol and process.
Path tracing
A diagnostic method that observes hops and path limits toward a destination.