/ factorpad.com / tech / linux-essentials / ping-command.html
An ad-free and cookie-free website.
Beginner
Videos can also be accessed from the Linux Essentials Playlist on YouTube.
Linux ping Command Summary with Examples (3:39)
Our eighty-second word, or command to memorize is
ping
from our category
Communication.
ping
allows you to send data packets
to hosts.
-options | description |
---|---|
-h ,
--help |
Print help screen |
-c ,
--count=NUMBER |
Send specific NUMBER of packets |
-w ,
--timeout=N |
Stop after N seconds |
Recall from recent videos (tutorials) we tackled user topics and now we'll switch to the topic of system communication. In this video we'll send small packets of data over the Internet to a host that normally sends them back.
Before we start, it helps to think of commands as mini programs and
most follow this structure:
command -option(s) argument(s)
.
The ping
command has
25 options, and the argument is the hostname. Host
names can be in one of two forms, either human digestible like
google.com, in Internet Protocol speak, like 24.58.108.13.
Like most commands, help is available with double-dash
--help
. You can limit the packets,
with -c
for a count, or
-w
for time.
We'll keep building on this conversation, but to start out just imagine these data packets traversing many hosts or computers, or routers, to the destination and back in fractions of a second.
So why is ping
an important command?
Well, if troubleshooting Internet connections at the command line is
your goal, ping is often the easiest method.
And now you know how to do that.
Okay, the best way to embed this in your memory is by typing in your own terminal window.
Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.
Here we go. So let's go with ping
optionless to factorpad.com
.
And notice how it keeps running, so in order to stop it, just like other
programs that are running, use our old trusty
Ctrl-c
.
And then really all we need often is just a few so let's
ping
five times and this time use
computer language using the IP address, just to see if that works.
It does, and last, because we like statistics here at FactorPad,
average and standard you can see here. Let's run a
ping
for 10 seconds using
-w
.
And then just looking at this, it looks very fast and the distribution looks quite tight.
Okay now you know how to use ping
.
And you know the syntax for commands, options and arguments.
One last tip about the ping
command. So since it is very important, find a link below to an
article on Internet Communication Protocols (on Wikipedia).
Okay, thanks for visiting today. I hope this was a helpful
introduction to the ping
command.
For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:
Join the smart crowd we're forming. Subscribe, join and tell a friend. Thank you.
adduser
command,
hit Back.traceroute
command, click Next./ factorpad.com / tech / linux-essentials / ping-command.html
A newly-updated free resource. Connect and refer a friend today.