Ping is the command line utility that is used to connect the host using the internet protocol. It sends the data in the form of small packets and determines different parameters including the number of packets transmitted and received. Also, the percentage of the lost packets and the time taken by the packets to reach the host address from the client machine.
All the information received through the output of the ping command is used to validate the availability of the host address. Also to confirm the status of the server either up or down and last but not least, for troubleshooting the connectivity issues.
Ping command line tool comes in all the platforms including the Windows, MacOS, and Linux operating systems. To use the ping command line tool on Windows and MacOS, follow the instructions explained in the mentioned blog.
However, this blog will explain the installation methods of ping on Debian 12 by different approaches. The outline of the post will be:
- What is the Method to Install ping Command Utility on Debian
- Install ping on Debian Using the Debian’s Default Package
- What is the Usage of the ping Command Utility on Debian
- How to Uninstall the ping on Debian
Let’s start the post by exploring the installation methods of ping on Debian.
What is the Method to Install ping Command Utility on Debian ?
Ping comes pre-installed on all distributions of Linux. The installation of ping on Debian can be confirmed by running the command:
$ which ping
The output will display the path of the installed package of the ping on Debian 12, but if the output displays no path then it means the package of ping is not installed on Debian.
It can be installed by following the next-mentioned method.
Install ping on Debian Using the Debian’s Default Package
We know that the Debian distribution comes with a default repository that contains different packages for software applications. To install the ping command from the default repository of Debian, follow the steps mentioned below.
Step 1: Access the Terminal
First, open the terminal using the shortcut key CTRL+ALT+T or from the “Application’s Menu” as shown:
Step 2: Update the Packages
Now use the apt command’s “update” package to ensure the installation of the updated ping package:
$ sudo apt update
Step 3: Install ping on Debian
Run the below-mentioned command to install the ping command tool from the default repository of Debian:
$ sudo apt install iputils-ping -y
The package will be completed after the successful execution of the command.
Step 4: Display the Version
On completion of the installation of the ping command, display its version:
$ ping -V
The version in the output is the confirmation of the installed ping command tool.
What is the Usage of the ping Command Utility on Debian?
To use the ping command on Debian 12, first, understand the general usage syntax of the ping command:
$ ping [options] host_or_IP_address
Use the options of the ping command according to the user’s requirement otherwise, it is optional. Then specify the hostname or its IP address, however, the IP address is recommended. Finally, press the ENTER key and the ping command will start sending and receiving packets to the specified IP address until it is stopped forcefully.
Different options that can be used mostly with the ping command are explained in the table below.
|This option allows the user to specify the number of packets to be sent to the host address
|It is used to set the time interval after which the next packet is supposed to be sent to the host address
|It is used to set the Time To Live of the packet
|It is used to specify the packet size which is supposed to be sent
Now some examples will be executed to explain the usage of the ping command following the above general syntax.
First, we will ping the “itslinuxfoss” website by sending 3 packets only with the “c” option:
$ ping -c 3 itslinuxfoss.com
The output displays the summary of the three packets which are sent to the host website.
Instead of using the hostname, the ping command can also used to send packets using the IP address:
$ ping 220.127.116.11
The packets will be sent to Google as shown in the output. Similarly, the default set time for sending the packet is one second, to change the time run the ping command with its “i” option:
$ ping -i 1.5 itslinuxfoss.com
The time is changed from one second to 1.5 seconds. Likewise, to stop the ping process, use the “w” option of the ping command:
$ ping -w 5 itslinuxfoss.com
The ping command will stop sending the packets to the host address after five seconds. Another usage option of the ping can be expired by displaying its manual using the command:
$ man ping
How to Uninstall the ping on Debian?
To uninstall and remove the ping package with its configuration file, execute the command:
$ sudo apt purge iputils-ping
This is all about installing and using the ping command on Debian 12.
To install the ping command, launch the terminal and execute the command “sudo apt install iputils-ping -y”. The ping command tests the newly created website by sending the packets to it.
Though the package of the ping command comes preinstalled, if it is not, then it can be installed by following the steps explained in this blog.