This article was co-authored by wikiHow staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for wikiHow. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions.
This article has been fact-checked, ensuring the accuracy of any cited facts and confirming the authority of its sources.
This article has been viewed 776,021 times.
Learn more...
The Linux ping command is helpful for troubleshooting and testing network speed, latency, and connectivity issues. Ping works by sending packets of data to an IP address or hostname and reporting how long it takes to receive a response. You can use the results of a ping test to figure out whether a website or server is reachable, and if so, whether there's any packet loss slowing things down. This wikiHow guide will teach you how to run the ping command in Linux, give examples of advanced ping commands, and help you understand the results.
Linux Ping Command: Overview + Basic Use
Ping works by sending packets of data to an IP address and reporting how long it takes for the packets to return (and if any get lost along the way). To ping in Linux, press Ctrl + Alt + T to open a terminal, type "ping <ip address>", and press Enter. The ping runs continuously until you press Ctrl + C to stop it.
Steps
How to Ping in Linux
-
Open a Terminal window. You can do this on most versions of Linux, including Ubuntu, by pressing Ctrl + Alt + T. You can also double-click the Terminal app icon in your app list.
-
Run a basic ping. At the prompt, type ping followed by the IP address, hostname, or domain name that you want to test. When you press Enter, you'll see the echoed results as individual entries.
-
Basic ping examples:
- To ping a website like Facebook, you'd type ping www.facebook.com or ping facebook.com.
- To ping an IPv4 IP address, such as 10.0.0.1, you'd type ping 10.0.0.1.
- To ping an IPv6 IP address, you'll add the -6 option. To ping Facebook's IPv6 address, you'd use ping -6 2a03:2880:f02c:13:face:b00c:0:3.
- You can also ping your own computer (localhost) to make sure your network adapter is working properly. To do this, you'd use ping localhost or ping 127.0.0.1.
- For more ping examples, see Advanced Ping Examples.
Advertisement -
Basic ping examples:
-
Press Ctrl+C to stop the ping. In Linux, the ping command will continue to display echo results until you stop the process with this keyboard shortcut. Once you stop the ping, you'll see a statistics summary of the ping right above the prompt.
Community Q&A
-
QuestionFrom root, can we ping others in Linux?
Community AnswerYes, in root or regular user you can. -
QuestionHow do I stop my machine from pinging other machines?
Community AnswerIn a command prompt, press "Ctrl + C" to end processes in a command line. If you are not actively doing it in a command line, see if your computer is connected to a network or VPN. If not, try to find which kind of device it's pinging and where it is located. If all else fails, either it's nothing or you are being watched/hacked. -
QuestionHow to stop a Linux Mint PC once you have used the ping command?
Community AnswerCntrl + C will stop the ping if you ever start it. You can do the same to stop just about any process in Linux if you started it via command.
Video
Tips
-
You can also use the ping command in Command Prompt on Windows and the Terminal app on a Mac.Thanks
-
Not all websites will allow you to ping their actual addresses.Thanks
References
- ↑ https://manpages.ubuntu.com/manpages/trusty/man8/ping.8.html
- ↑ https://www.ibm.com/docs/en/aix/7.2?topic=p-ping-command
- ↑ https://manpages.ubuntu.com/manpages/trusty/man8/ping.8.html
- ↑ https://www.intel.com/content/www/us/en/gaming/resources/how-to-fix-packet-loss.html
- ↑ https://developer.mozilla.org/en-US/docs/Glossary/Round_Trip_Time_(RTT)
- ↑ https://www.youtube.com/watch?v=ICk5fViPVQM
About This Article
1. Press Ctrl+Alt+T to open the terminal.
2. Type "sudo ping -v" to install Ping Version
3. Type "Ping" followed by the website or IP address you want to ping.
4. Press Enter.













