November 29, 2016

Using Ping on a Mac

Being a long time Microsoft Windows user, I was surprised to find out a fun feature of Apple MacOS terminal command--ping.

If you are not familiar with the ubiquitous tool, on most systems it is a way to send a simple ICMP ECHO_REQUEST packet to network hosts. In plain English, it means you can send a small network message to a node on the network and it will reply back. Depending on the length of time between the send and the reply you can figure out rough network performance.

Below is the familiar interface on Windows.

ping -t 192.168.1.1

Note: the -t makes the command continuous.  This means that it will continue to ping over and over again--never stopping vs the default of a three ping count.



On a Mac, you have a couple of extra options.

By default, every ping on a Mac is continuous. 

You can ping a node on the network and have it make an audible beep every time it gets a successful reply. This is very useful if you want to verify a machine is still up and running while doing other tasks.

ping -a 192.168.1.1

Conversely, you may want to get an audible beep only when a server is NOT responding. This is very handy if you have requested a server to reboot after installing updates. The audible and visual cues make it easy to pin point exactly when the reboot occurs.

ping -A 192.168.1.1

Depending on which system you are using, there are many other options you can run while using ping but these are a couple I find useful while using a Mac.

Drop me a line in the comments if this is useful to you or if you have any questions,

Brian Olsen @sagelikebrian
 

No comments:

Post a Comment