How can I make the Linux ping to show the requests 'time out' instead of omitting the output?
Just like the Windows version of ping.
|
How can I make the Linux ping to show the requests 'time out' instead of omitting the output? Just like the Windows version of ping. | |||
|
feedback
|
This question came from our site for system administrators and desktop support professionals.
|
There's no way for the common
If the ping fails, The other option is using
| |||
|
feedback
|
|
When I use ping to see if a host is up in shell scripts, I do something like this:
Basically, sends one ICMP that times out in a second with no output and uses the exit code to gate further action. | |||
|
feedback
|
|
I am afraid but there is no 100% solution to that with standard ping. Even with ping -v for verbose output ping would be silent in case of timeouts. You could try to use:
This would stop ping after 2 seconds and then show the number of packets transmitted and packet loss. Another option would be to use mtr. | |||
|
feedback
|