How to use PING Command in Linux Ubuntu 19.10/18.04 LTS?

Ping a message to know the host/server!!

Ping command on Linux

PING Command in Linux: PING is a shortened form of Packet Internet or Inter-Network Groper. The Ping Command is one of the most used utilities for identifying, troubleshooting and testing issues related to network connectivity. The Ping command takes input as the URL or IP address and sends a data packet with the message “PING” to the specified address and obtain a response from the host/server and this recorded time is called latency. Ping works by sending ICMP (Internet Control Message Protocol) echo request messages to a defined IP destination on the network and waits for the ICMP reply. Using this ping command, you can test if a host is reachable(active) on an IP network or not. In an Internet Protocol (IP) packet, Time-to-live (TTL) is a value that informs a network router whether or not the IP packet has been in the network too long and should be rejected. In general, the ping time is calculated in milliseconds. It is the round trip time for the packet to reach the host/server and for the return response to the sender. In this article, we will assist you to make use of ping command Linux effectively.

Jump To:

How to use Ping Command?

The ping command needs to be used in the below format in your Ubuntu Terminal. In the destination place, you can type/paste the URL/IP address in order to check the network connectivity.

ping [options] [destination]

Note: To stop pinging, you have to use Ctrl+C or else it will keep on sending packets.

  • In the below screenshot, you can find that we have used google URL to illustrate the ping command usage. You just have to click on Ctrl+C to stop the ping process. You can find the details related to TTL, time, packets transmitted/received and packets loss over the network.
Check this too  How to Check Battery Status in Ubuntu 18.04, 19.04 & 19.10?
Ping Command Usage
Ping Command Usage

Examples to use Ping Command:

Let’s look out some examples of using Ping command with the available options.

Ping Version:

Execute the below command to know the version of ping available on your system.

ping -V
Ping Version
Ping Version

To control the number of pings:

In order to define the number of packets that you want to send to the host/server, you have to use the below command format.

ping -c [count] [destination]
Control the number of pings
Control the number of pings

Ping Command – Options:

  <destination>      dns name or ip address
  -a                 use audible ping
  -A                 use adaptive ping
  -B                 sticky source address
  -c <count>         stop after <count> replies
  -D                 print timestamps
  -d                 use SO_DEBUG socket option
  -f                 flood ping
  -h                 print help and exit
  -I <interface>     either interface name or address
  -i <interval>      seconds between sending each packet
  -L                 suppress loopback of multicast packets
  -l <preload>       send <preload> number of packages while waiting replies
  -m <mark>          tag the packets going out
  -M <pmtud opt>     define mtu discovery, can be one of <do|dont|want>
  -n                 no dns name resolution
  -O                 report outstanding replies
  -p <pattern>       contents of padding byte
  -q                 quiet output
  -Q <tclass>        use quality of service <tclass> bits
  -s <size>          use <size> as number of data bytes to be sent
  -S <size>          use <size> as SO_SNDBUF socket option value
  -t <ttl>           define time to live
  -U                 print user-to-user latency
  -v                 verbose output
  -V                 print version and exit
  -w <deadline>      reply wait <deadline> in seconds
  -W <timeout>       time to wait for response
IPv4 options:
  -4                 use IPv4
  -b                 allow pinging broadcast
  -R                 record route
  -T <timestamp>     define timestamp, can be one of <tsonly|tsandaddr|tsprespec>
IPv6 options:
  -6                 use IPv6
  -F <flowlabel>     define flow label, default is random
  -N <nodeinfo opt>  use icmp6 node info query, try <help> as argument

Get Help from Ping Command:

In order to get help from the Ping command, you have to execute any one of the following commands on the Ubuntu Terminal.

ping -help
ping -h

A Short Synopsis:

In the above article, we have described the usage of ping command Linux with relevant examples for your reference. We hope that you can utilize this command on Linux Ubuntu 19.10 Eoan Ermine/ 18.04 LTS Bionic Beaver in an effortless manner. If you find this article is helpful, kindly share your valuable queries/suggestions in the below comment section.

Check this too  WC Command in Linux Explained with the real time Examples!!

Leave a Reply

Your email address will not be published. Required fields are marked *


Written by Lisa

Lisa is a technical writer who assists readers with quality content as part of a Tec Robust team. Her writing helps people from diverse professional backgrounds. Her article makes you gain clarity on technical topics as she knows what is right for you.


How to Install Node.js on Fedora 31 ?

How to Install Opera Web Browser on Elementary OS

How to Install Opera Web Browser on Elementary OS 5.1.2 Hera?