Install fping on Ubuntu 20.04

The fping is a command line tool that enables to send ICMP echo requests to the network hosts to determine whether a host is reachable. The fping is similar to the ping command, except fping can accept many hosts provided as command line arguments. The fping supports reading hosts from a text file.

This tutorial shows how to install fping on Ubuntu 20.04.

Install fping

Execute the following command to update the package lists:

sudo apt update

Install fping:

sudo apt install -y fping

We can check fping version as follows:

fping --version

Testing fping

Execute the fping command and provide any number of hosts as arguments in order to ping hosts:

fping -c 3 google.com youtube.com

Command prints results in the following format:

google.com  : [0], 84 bytes, 29.8 ms (29.8 avg, 0% loss)
youtube.com : [0], 84 bytes, 23.6 ms (23.6 avg, 0% loss)
google.com  : [1], 84 bytes, 27.7 ms (28.8 avg, 0% loss)
youtube.com : [1], 84 bytes, 24.0 ms (23.8 avg, 0% loss)
google.com  : [2], 84 bytes, 28.0 ms (28.5 avg, 0% loss)
youtube.com : [2], 84 bytes, 26.7 ms (24.7 avg, 0% loss)

google.com  : xmt/rcv/%loss = 3/3/0%, min/avg/max = 27.7/28.5/29.8
youtube.com : xmt/rcv/%loss = 3/3/0%, min/avg/max = 23.6/24.7/26.7

We can use the -c option to specify the number of requests to be sent to each host.

The -f option can be used to provide a text file that contains a list of hosts:

printf "google.com\nyoutube.com" > test.txt

fping -c 3 -f test.txt

Uninstall fping

If you decided to completely remove fping, run the following command:

sudo apt purge --autoremove -y fping

Leave a Comment

Your email address will not be published.