#oEmbed (JSON) oEmbed (XML) IFRAME: about:blank Skip to content Linux TLDR (BUTTON) Menu ____________________ (BUTTON) Menu * 🏠 Home * 🐧 Topic + All in One + DevOps o Ansible o AWS o Docker o Git o Jenkins o Kubernetes + Hardware o Raspberry Pi + How to + Linux Commands o Builtin Commands o Curl Commands o Homebrew Commands o MySQL Commands o SSH Commands + Linux Distributions o Alma Linux o Debian o Fedora o Kali Linux o Linux Mint o Manjaro o Red Hat o Ubuntu + News & Updates + Package Installer + Programming o Bash Scripting o C/C++ o Go Lang o Java o Javascript o Node Js o Php o Python o Ruby + Reviews + Tools + Troubleshooting + Tutorials + Weekly Roundup + What is * 🕵️ Privacy Policy * 📧 Contact Us * 📖 About + 🪶 Write an Article + 🔗 Follow Us + 🎁 Donate Beginners Guide for Ping Command in Linux Linux TLDR Last Updated: December 17, 2025 No Comments Reading time: 4 minutes PING, also known as “Packet Internet Groper”, is the most common networking tool used in Windows, Linux, and macOS to test the connection between the source and the destination. The destination, or remote system, could be a web server, your router, or a computer on your local network; you will specify them with their domain or IP address. When you specify the destination (domain or IP address), the ping command will send a series of ICMP (Internet Control Message Protocol) packets to the remote system and wait for the response. In the response output, you will get different pieces of information using which you can determine whether the remote system is alive or not, the latency of the network, and how many packets are dropped. Although you might already be aware of the basic usage of this command, stick with this article to learn several variations and options for the ping command (with examples). Table of Contents Toggle * Tutorial Details * Ping Command Usage * Ping a Host Only a Specific Number of Times * Setting the Ping Timeout * Change the Time Interval While Sending Each Packet * Changing the ICMP Packet Size * Do not Lookup the Symbolic Names for the Host * DoS Attack with Ping Flooding * Every Successful Ping is Accompanied by a Sound Alert. Tutorial Details Description Ping Difficulty Level Low Root or Sudo Privileges No OS Compatibility Ubuntu, Manjaro, Fedora, etc. Prerequisites ping Internet Required No Ping Command Usage The simplest way to use the ping command (which you might already know) is to specify the domain or IP address of the destination without any options. In the following command, “google.com” is being ping to test whether the domain is alive or not by sending ICMP packets of 56 bytes. $ ping google.com #OR $ ping 142.250.192.14 Output: Pinging the remote host Note that the ping command will keep pinging the remote system unless you manually stop it by pressing the “Ctrl+C” shortcut key. Once you stop the ping command, it will give you a summary of all the transmissions made between the source and destination that includes the following information: * from: It identifies the target by its IP address (the simplest way to obtain the IP address of any domain name). * icmp_seq: It’s the sequence of the ICMP packet sent to the server in order. * ttl: It tells how long a packet is allowed to stay in a network before it is thrown away by a router. * time: It tells the amount of time it took for the referenced packet to reach the remote system and come back to the origin. In addition, you will receive a summary of the total number of transmitted and received packets, the number of lost packets, and the average time spent exchanging a packet. Now that you know how the ping command works and how to read its output, let’s see some of the other examples of the ping command’s usage with its options. * How to Ping Multiple Hosts at High Performance with fping in Linux Ping a Host Only a Specific Number of Times The default behavior of the ping command is to keep pinging the remote system unless the user manually stops the ping command. However, you can use the “-c” flag with the number of packets to send on the remote system, after which the ping command will automatically stop. For example, the following command will only ping “google.com” twice. $ ping -c 2 google.com Output: Sending a definite number of packets to the remote system Apart from the number of packets, you can stop the ping command by specifying the timeout that you will learn in the next section. Setting the Ping Timeout Aside from defining the number of packets to send, you can also specify the timeout using the “-w” flag, at which the ping command will automatically stop. For example, the following command will only ping “google.com” for five seconds. $ ping -w 5 google.com Output: Setting the timeout for the ping command Change the Time Interval While Sending Each Packet The default behavior of the ping command is to send packets at an interval of one second. However, you can use the “-i” flag to change the time interval between two pings to prevent getting blocked by the remote system. For example, the following command will send ICMP packets to the remote system after two seconds on each request. $ ping -i 2 google.com Output: Sending packet to remote system after two seconds It should be noted that you can specify the time interval in milliseconds by assigning a value in floating point (decimal value), but you must do so as root or with sudo privileges. 📝 Reducing the interval time below one second will increase the chance of packet loss (especially in a slow network). For example, the following command will send the ICMP packet to the remote system after 0.5 seconds (500 ms). $ ping -i 0.5 google.com Output: Sending packet to remote system after point five milliseconds Changing the ICMP Packet Size By default, the ping command sends the ICMP packets in 56 bytes, as you can see in the earlier outputs, but you are not limited to using this predefined size. Using the “-s” flag, you can send a remote system a custom-sized ICMP packet in bytes. The following command will send an ICMP packet size of 100 bytes to “google.com“. $ ping -s 100 google.com Output: Using custom packet size while sending on remote system Do not Lookup the Symbolic Names for the Host By default, the ping command looks for the symbolic names in specified DNS records to give the host name instead of an IP address. This could be easily avoided by using the “-n” flag. For example, the following command will only give you the numeric output for “google.com” instead of symbolic names. $ ping -n google.com Output: Do not look for the symbolic names DoS Attack with Ping Flooding One of the simple ways to determine the response of your remote system (or server) under high-load conditions is by initiating the DoS attack using the ping command, also known as “ping flooding“. In this scenario, the ping command will send a large number of ping requests as fast as possible in a very short time frame. ⚠️ If you are ping flooding on your own server, then it’s okay (unless you are using shared hosting), but if you are testing on someone else’s server, you might get no response or get blocked by the server as many servers do not allow ICMP requests. For example, the following command with the “-f” flag will stress test “google.com” unless you manually interrupt the ping command. 📝 The following command will only be initiated by root or users with sudo privileges. $ ping -f google.com Output: Ping overload on the remote system When you initiate the ping flood, you will see some dots keep appearing and disappearing in the output. Every “.” dot is a request, and a backspace is the answer. Since the backspace clears the dots, the dot appears and disappears. * Block/Unblock Ping ICMP Requests in the Linux System Every Successful Ping is Accompanied by a Sound Alert. If you use the “-a” flag with the ping command, every successful ping request to the remote system will make a sound. 📝 Some systems might not hear the beep noise. If it happens to you, notify us of your system name in the comment section. $ ping -a google.com Output: Alert with sound on every successful ping So, that’s all for now. If you have any questions or queries related to this topic, feel free to ask them in the comment section. SHARE: Recommended Articles 🔗How to Install Zabbix Server on Ubuntu 24.04 (Noble Numbat) 🔗Stellar Repair for MySQL – Product Review 🔗How to Install RQuickShare (NearbyShare/QuickShare) on Linux 🔗How to Install RabbitMQ Server on Linux (Quick Guide) 🔗How to Use Chattr Command in Linux (for Beginners) 🔗How to Setup SOCKS5 Proxy Server on Linux Using MicroSocks 🔗Reset the WordPress Admin Password Using CLI (via 2 Methods) 🔗How to Check Python Version in Linux (via 3 Methods) 🔗How to Check PHP Version in Linux (via 4 Methods) 🔗[Fixed] pkg-config script could not be found in Linux Join The Conversation Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy. Cancel reply Comment _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ _____________________________________________ Name ______________________________ Email ______________________________ [ ] Save my name, email, and website in this browser for the next time I comment. [Don't subscribe_______] Notify me of followup comments via e-mail. You can also subscribe without commenting. Post Comment Latest Install zabbix server on ubuntu How to Install Zabbix Server on Ubuntu 24.04 (Noble Numbat) mysql database recovery tool Stellar Repair for MySQL – Product Review RQuickShare Linux How to Install RQuickShare (NearbyShare/QuickShare) on Linux Install RabbitMQ Server on Linux How to Install RabbitMQ Server on Linux (Quick Guide) chattr command How to Use Chattr Command in Linux (for Beginners) Newsletter Explore the latest Linux news, tutorials, tips, and resources to master open-source technology. Social Handles Your help is needed AI and ad blockers are significantly impacting advertising revenue. Donate now to support funding for this independent site. 🎁 Make a Donation Linux TLDR © 2025 - Discover, Learn, and Master Linux with Us 🐧 x