How To Ping a Server for a few Seconds

While learning about the Docker Network feature I stumbled about a usefull ping option I didn't know before. -w SEC. With SEC being the seconds until ping exits.

$ ping -w3
PING ( 56 data bytes
64 bytes from seq=0 ttl=64 time=0.124 ms
64 bytes from seq=1 ttl=64 time=0.103 ms
64 bytes from seq=2 ttl=64 time=0.102 ms

--- ping statistics ---
3 packets transmitted, 3 packets received, 0% packet loss
round-trip min/avg/max = 0.102/0.109/0.124 ms


Show Comments