How to Ping on Linux: 9 Steps (with Pictures)

Table of contents:

How to Ping on Linux: 9 Steps (with Pictures)
How to Ping on Linux: 9 Steps (with Pictures)

Video: How to Ping on Linux: 9 Steps (with Pictures)

Video: How to Ping on Linux: 9 Steps (with Pictures)
Video: How To Make Money On WhatsApp in 2023 For Beginners 2024, May
Anonim

This wikiHow teaches you how to test the connection between a Linux computer and another using the " ping " command. You can also use an advanced version of the “ping” command called “traceroute “to find out what other IP addresses a computer is asking for to reach another computer's address.

Step

Method 1 of 2: Using the “Ping” Command

Ping in Linux Step 2
Ping in Linux Step 2

Step 1. Open Terminal on the computer

Click (or double-click) the Terminal icon, which looks like a black box with a white >_" symbol inside. You can also press Ctrl+Alt+T simultaneously.

Ping in Linux Step 3
Ping in Linux Step 3

Step 2. Type the command " ping"

Enter the ping, followed by the web address or IP of the website you want to ping.

For example, to ping the Facebook site, type ping www.facebook.com

Ping in Linux Step 4
Ping in Linux Step 4

Step 3. Press Enter

The “ping” command will be executed and a request to that address will be sent.

Ping in Linux Step 5
Ping in Linux Step 5

Step 4. Review the ping speed

On the right side of each displayed row, you'll see a number, followed by a short "ms". The number represents the time (in milliseconds) it takes the target computer to respond to a data request.

  • The smaller the number displayed, the faster the connection between you from another computer or the target website.
  • When pinging a web address in Terminal, the second line shows the IP address of the website you are pinging. You can use it to ping a website instead of an IP address.
Ping in Linux Step 6
Ping in Linux Step 6

Step 5. Stop the ping process

The command " ping " will run continuously. To stop it, press the shortcut Ctrl+C. The command will be terminated and the ping result will be displayed under the "^C" line.

To see the average length it takes for other computers to respond to data requests, observe the number after the first slash (“/”) in the line under the “# packets transmitted, # received” segment

Method 2 of 2: Using the Traceroute Command

Ping in Linux Step 8
Ping in Linux Step 8

Step 1. Open Terminal on the computer

Click (or double-click) the Terminal icon, which looks like a black box with a white >_" symbol inside. You can also press Ctrl+Alt+T simultaneously.

Ping in Linux Step 9
Ping in Linux Step 9

Step 2. Type the command " traceroute"

Enter the traceroute, followed by the IP address or website you want to track.

For example, to trace the route from your router to Facebook's servers, type traceroute www.facebook.com

Ping in Linux Step 10
Ping in Linux Step 10

Step 3. Press Enter

The command " traceroute " will be executed.

Ping in Linux Step 11
Ping in Linux Step 11

Step 4. Review the route the data request took

On the left side of each new line that appears, you can see the IP address of the router that processed the tracking request. You can also see the time (in milliseconds) it took to process the request at the far right of the line.

  • If you see an asterisk for one of the routes, the server that the computer should be connected to is either down or not connected to the network so the computer should try to access another address.
  • The traceroute command will stop once the data request reaches its destination.

Tips

The " ping " command described in this article can also be used verbatim in Command Prompt on Windows computers and Terminal on Mac computers

Recommended: