The UNIX ping command permits you to check community servers and latency. This is the way to use it within the macOS Terminal app.
The UNIX ping
command is a tiny UNIX community instrument that permits you to check your community, that of your ISP or group, distant servers, and community latency.
ping
is among the oldest and easiest UNIX instructions and is out there in just about 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 automobile accident on Interstate 95 in Maryland.
Muuss was additionally the creator 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 net web page remains to be out there 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 tackle 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’ll be able to 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 normal community and packet errors.
Utilizing ping on macOS
To make use of ping
on macOS, open the Terminal utility in your Startup Disk’s /Functions/Utilities folder, then kind the ping
command adopted by an area, then an IP tackle or area identify. Press Return in your keyboard to begin the command.
For instance, you’ll be able to ping
Apple itself in Terminal with:
ping
apple.com and urgent Return.
In case your laptop has a working web connection you may see ping
start its exams, which can hold working till you cease it by urgent Command-Z in your keyboard (except you specified the -c
(depend) choice with the command).
Whenever you use ping
, you’ll be able to specify both the IP tackle of the goal laptop or a site identify. In the event you use a site, 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 may be additionally an IPv6-enabled model of ping
known as ping6
which can be out there on macOS.
Choices
ping
has a number of dozen choices. To see them kind:
man ping
in Terminal and press Return.
Choices embrace (however are usually not restricted to):
- Audible bell (for failures)
- Take a look at depend
- Wait occasions
- Kind of community service
- TTL
- A supply tackle
- 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 offers a number 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 machine 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 check present:
- Bytes obtained
IP of responder
TTL
Spherical journey time (in ms)
Packet sequence quantity
In the event you did not specify the variety of exams to run utilizing the -c
flag, press Command-Z in your keyboard to finish the exams.
ping
is a fast and simple technique to conduct community exams by yourself community, your Mac, and on distant machines. As soon as you know the way it really works, you may end up utilizing it on a regular basis.