On Ubuntu 22.04, the Ping command is used to send “ICMP ECHO_REQUEST” packets over the network host. A user can check the access time between sending a request and hearing back by using the Ping command. The Ping command provides precise connectivity information and is used to check the performance of the network and host. It is also utilized to find out how many packets are transferred and how many are lost during the transmission.
The Ping command installation, use, and removal on Ubuntu 22.04 will be demonstrated in this post.
Ping command installation on Ubuntu 22.04
On Ubuntu 22.04 in order to install the Ping command, follow the below-given steps.
Step 1: Update system packages
First, press “CTRL+ALT+T” to open the terminal and update and upgrade the system packages:
$ sudo apt update && sudo apt upgrade
Step 2: Install Ping command
Use the command listed below to install the Ping command on your Ubuntu 22.04 system:
$ sudo apt install iputils-ping
Step 3: Ping verification
Verify the installation of the Ping command by checking the path where it is installed:
$ which ping
We have successfully installed Ping on the system, now move forward to check the method to use it.
How to use Ping command on Ubuntu 22.04
To use the Ping command on Ubuntu 22.04, go through the syntax and the demonstrated examples.
Syntax
Use the “ping” keyword along with the “options” and then mention the “hostname” or “IP”:
$ ping [options] [hostname/IP]
Some important options supported by the “ping” command are:
Options | Description |
---|---|
-c | To get the number of requests the user will perform. |
-a | Create an alert and check the activation status of the host. |
-i | Enable to set intervals. |
-f | Allow users to send packets of 100 or more. |
Examples
Let’s check out the whether the Ping command is working properly:
$ ping -c 1 itslinuxfoss.com
The given output indicates that we have successfully received a packet with the help of the Ping command:
Using “ping” along with “-i 3” the time interval is set to “300s” and “-c 2” it will transmit and receive “2” packets:
$ ping -i 3 -c 2 itslinuxfoss.com
Now, let’s check out how to remove the Ping command from Ubuntu 22.04.
How to remove Ping command from Ubuntu 22.04
To remove Ping from Ubuntu 22.04, process the following command:
$ sudo apt remove iputils-ping
We have completely described the ways to install, use, and remove the Ping command on Ubuntu 22.04.
Conclusion
Ping command is used to send “ICMP ECHO_REQUEST” packets over the network host. On Ubuntu 22.04, install the Ping command by executing “$ sudo apt install iputils-ping” on Ubuntu’s terminal. You can also verify the Ping command installation using “$ which ping” and use it along with different options. In this post, we have effectively explained the way to install, use, and remove the Ping command on Ubuntu 22.04.
TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY