The UNIX ping command permits you to check community servers and latency. Here is find out how to use it within the macOS Terminal app.
The UNIX ping
command is a tiny UNIX community instrument that lets you check your community, that of your ISP or group, distant servers, and community latency.
ping
is likely one of 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 automobile 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 net web page continues to be obtainable on one of many first fifty servers on the web: a US Military FTP server for the Ballistics Lab.
The ping
command works through the use of the Web Management Message Protocol (ICMP) – particularly by sending ECHO_REQUEST
packets, and by using its Time To Reside (TTL), latency, and packet loss detection to measure spherical journey hops to a given internet-connected pc at both an IP deal with or area identify.
Do not confuse Time To Reside with a unique topic from electronics: Transistor-to-transistor Logic (additionally abbreviated ‘TTL’).
The identify “ping” comes from submarine SONAR expertise 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 pc and the vacation spot, round-trip instances, and whether or not a given pc is on-line or not.
You too can use ping
to search for basic 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 sort the ping
command adopted by an area, then an IP deal with or area identify. Press Return in your keyboard to start out the command.
For instance, you’ll be able to ping
Apple itself in Terminal with:
ping
apple.com and urgent Return.
In case your pc has a working web connection you may see ping
start its exams, which can preserve working till you cease it by urgent Command-Z in your keyboard (except you specified the -c
(rely) choice with the command).
If you use ping
, you’ll be able to specify both the IP deal with of the goal pc or a site identify. In case 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’s additionally an IPv6-enabled model of ping
known as ping6
which can also be obtainable on macOS.
Choices
ping
has a number of dozen choices. To see them sort:
man ping
in Terminal and press Return.
Choices embrace (however usually are not restricted to):
- Audible bell (for failures)
- Check rely
- Wait instances
- Sort of community service
- TTL
- A supply deal with
- 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 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 pc’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 acquired
IP of responder
TTL
Spherical journey time (in ms)
Packet sequence quantity
In case 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 option 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.