My Board
Ping Command Syntax and Options - Printable Version

+- My Board (https://ellohost.com/forum)
+-- Forum: Tutoriel EN (https://ellohost.com/forum/forumdisplay.php?fid=8)
+--- Forum: Others (https://ellohost.com/forum/forumdisplay.php?fid=20)
+--- Thread: Ping Command Syntax and Options (/showthread.php?tid=799)



Ping Command Syntax and Options - aaron - 09-10-2023


    Ping Command Syntax and Options
   

Ping Command Syntax and Options


   

The ping command is commonly pre-installed on most Linux operating systems. To check if your system has it, query the installed ping version using this command:


   
ping -V

   

If ping is installed, you will see the version number. Otherwise, Terminal will return the command not found error.


   

Depending on your machine’s operating system, the installation steps may differ. For example, we will run this Linux command to install ping on our Ubuntu 20.04 test system:


   
sudo apt-get update && install iputils-ping

   

Once installed, run the ping command with the following syntax. It should be the same for all distributions:


   
ping option destination

   

Replace destination with the target system’s exact IP address, hostname, or URL. You can also add an option to specify the command’s behavior. Here are some of the most popular options:


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
OptionUsage
-csets how many packets to send
-aplays a sound when the destination responds
-ichanges the interval to send packets
-venables verbose output
-Vchecks the ping version
-qsummarizes all the ping results in one output
-ffloods the destination host with a large number of packets for stress tests
-4 and -6specify the destination IP address protocol as IPv4 or IPv6, respectively
-smodifies the maximum transmission unit
-Dstarts each ping result with a UNIX timestamp
-W or -wsets a timeout for each packet or session, respectively