Use Terminal to Ping With Timestamp - Purple Computing
network

How To: Use Terminal to Ping With Timestamp (For Network Troubleshooting)


On macOS, this is a useful Terminal command to ping a network device repeatedly at a set internal, and log the timestamp with the ping reply.

This technique is good to evaluate the availability of a network device over a period time, if for example you suspect that a device or server is dropping off the network randomly (or not responding) at certain times of day.

You can use the -i flag to set a longer interval in seconds, which makes the ping output log easier to look through over an extended period. By default, ping will run every second, which can make it rather tedious when looking back through your ping results to find any significant dropouts.

ping -i 10 8.8.8.8 |¬†while read pong; do echo “$(date): $pong”; done

The above command will ping the IP address 8.8.8.8 (Google DNS) every 10 seconds (-i 10) and will timestamp the corresponding pongs.

Real-Time Feedback

When we solve a support ticket, clients are given the choice of leaving good or bad feedback along with an optional comment. We post the 10 most recent comments here automatically and in real-time. You can view even more on our page.

Date Name Comments
Sep 20th Lynn H great service as always. many thanks
Sep 14th Longcroft O Thanks so much Jack, all sorted.
Sep 14th Longcroft O Fantastic as usual, thank you Lochie.
Sep 14th Amanda H I hope the problem is solved. Sorry not to have been able to find another example of what went wrong. Definitely I can now get at the word document I was being blocked from. So, thanks for your prompt effective treatment!
Sep 13th Nigel B Very practical and quick advice that made resolving the issue very efficient
Sep 6th Alexandra O Very quick and solved the problem easily, thank you Jack.
Sep 5th Chris S another one solved....
Aug 23rd Adina I Brilliant, thank you very much!
Aug 23rd Catherine E Excellent
Aug 22nd Graham R Excellent, as always. Thanks very much!