Master the Linux ‘ping’ Command: A Comprehensive Guide for Beginners

Peter Hou
2 min readJun 3, 2023

--

This article provides a comprehensive guide to the Linux ‘ping’ command, exploring its history, common usage, key parameters, and several usage scenarios. The ‘ping’ command is a fundamental network diagnostic tool, and understanding its functionality is key for anyone interested in networking or Linux system administration.

Instructions

This article provides a thorough tutorial for Linux beginners about the ‘ping’ command. It covers the command’s history, purpose, usage, common parameters, and a selection of use cases.

History

The ‘ping’ command was first developed in 1983 by Mike Muuss, who wrote the software as a tool to troubleshoot issues with the IP network.

When and why to use it

The ‘ping’ command is used to check the network connectivity between the host machine and the target IP address or domain. It’s extremely useful in troubleshooting network issues.

How to use it

To use the ‘ping’ command, simply type ‘ping’, followed by the IP address or domain name of the target machine.

$ ping 8.8.8.8

The commonly used parameters

The ‘ping’ command comes with a range of parameters, some of the most common include:

  • -c allows you to specify the number of packets to send to the target machine.
$ ping -c 5 8.8.8.8
  • -i allows you to set the interval between successive packet transmissions.
$ ping -i 2 8.8.8.8

Other supported parameters

Other parameters for the ‘ping’ command include -a, -b, -f, -n, -q, -r, -v, and -w. Each parameter provides specific functionality to the ping requests.

Most common use cases

One of the most common use cases of the ‘ping’ command is to check if a particular website is accessible from your machine.

$ ping www.google.com

The tricky skills

One interesting usage of the ‘ping’ command involves using it to determine the strength of your network connection. By looking at the time taken for a packet to travel to the target machine and back (RTT), you can infer the strength of the network connection.

$ ping -c 5 www.google.com

What needs to be noted

It’s worth noting that the ‘ping’ command will continue to send packets until it’s interrupted, so it’s good practice to use the -c parameter to limit the number of packets sent.

Conclusion

Understanding how to use the ‘ping’ command is a fundamental skill for any Linux user. It’s a simple, yet powerful tool for diagnosing network issues and verifying connectivity.

--

--

Peter Hou
Peter Hou

Written by Peter Hou

I am a Senior Software Engineer and tech lead in a top tech company.

No responses yet