The UNIX ping command helps you to take a look at community servers and latency. This is the best way to use it within the macOS Terminal app.
The UNIX ping
command is a tiny UNIX community device that lets you take a look at your community, that of your ISP or group, distant servers, and community latency.
ping
is among the oldest and easiest UNIX instructions and is accessible in nearly all UNIX distributions, together with macOS.
ping
was written by the late Mike Muuss in 1983 on the US Military Protection Ballistics Lab. Sadly, Muuss died younger in 2000 on the age of 42, in a automotive accident on Interstate 95 in Maryland.
Muuss was additionally the writer of a number of 3D/CAD apps on the time, in addition to the UNIX utility ttcp
which measures community throughput utilizing TCP and UDP protocols. Muuss’ authentic technical web page remains to be accessible on one of many first fifty servers on the web: a US Military FTP server for the Ballistics Lab.
The ping
command works by utilizing the Web Management Message Protocol (ICMP) – specifically by sending ECHO_REQUEST
packets, and by using its Time To Dwell (TTL), latency, and packet loss detection to measure spherical journey hops to a given internet-connected laptop at both an IP handle or area identify.
Do not confuse Time To Dwell with a distinct topic from electronics: Transistor-to-transistor Logic (additionally abbreviated ‘TTL’).
The identify “ping” comes from submarine SONAR know-how which detects underwater vessels by emitting sound waves, after which measuring the time it takes for echoes to return.
With ping
you possibly can detect in case your community is working, hops in between your laptop and the vacation spot, round-trip occasions, and whether or not a given laptop is on-line or not.
You too can use ping
to search for common community and packet errors.
Utilizing ping on macOS
To make use of ping
on macOS, open the Terminal software in your Startup Disk’s /Functions/Utilities folder, then sort the ping
command adopted by an area, then an IP handle or area identify. Press Return in your keyboard to begin the command.
For instance, you possibly can ping
Apple itself in Terminal with:
ping
apple.com and urgent Return.
In case your laptop has a working web connection you will see ping
start its checks, which can hold operating till you cease it by urgent Command-Z in your keyboard (except you specified the -c
(rely) possibility with the command).
If you use ping
, you possibly can specify both the IP handle of the goal laptop or a website identify. In case you use a website, ping
will use DNS to resolve the area identify to that area’s default server (or to a gateway or CDN that factors to the default server).
There’s additionally an IPv6-enabled model of ping
referred to as ping6
which can be accessible on macOS.
Choices
ping
has a number of dozen choices. To see them sort:
man ping
in Terminal and press Return.
Choices embody (however usually are not restricted to):
- Audible bell (for failures)
- Take a look at rely
- Wait occasions
- Sort of community service
- TTL
- A supply handle
- Packet dimension
- Packet flooding
- Recording of routes
- Distant netmask printing
- Bypass routing tables
- Quiet or verbose mode (for error messages)
- SO_DEBUG flag (for recording)
Apple additionally supplies a couple of extra choices discovered solely within the macOS model of ping
together with:
- Community interface to bind
Prohibiting mobile interfaces
Obtain timestamp
See the man
web page in Terminal for full choices.
You too can ping your personal laptop’s community interface to see if the gadget is working correctly or not.
If any duplicate or broken packets are detected, ping
will show these too.
Default ping
outcomes displayed in Terminal for every take a look at present:
- Bytes obtained
IP of responder
TTL
Spherical journey time (in ms)
Packet sequence quantity
In case you did not specify the variety of checks to run utilizing the -c
flag, press Command-Z in your keyboard to finish the checks.
ping
is a fast and simple technique to conduct community checks by yourself community, your Mac, and on distant machines. As soon as you understand how it really works, you will end up utilizing it on a regular basis.
Source link