What is the -w
(deadline) flag in ping
for? I cannot find a description of it in the ping
man page; only for -W
, which takes seconds as a parameter. What is the difference between them, and how can I set a ping timeout (if host is not responding) to 200ms?
Shell Ping – Difference Between Ping -w and Ping -W
pingshelltimeout
Best Answer
From
man ping
:That is,
-w
sets the timeout for the entire program session. If you set-w 30
,ping
(the program) will exit after 30 seconds.-W
on the other hand sets the timeout for a single ping. If you set-W 1
, that particular ping attempt will time out.As for how to set an individual ping timeout of 200ms, I don't believe this can be done with
iputils
' version ofping
. You might want to try directly programming with an ICMP library.