How to Ping on Linux

Author: Laura McKinney
Date Of Creation: 6 August 2021
Update Date: 1 July 2024
Anonim
Linux ping command summary with examples
Video: Linux ping command summary with examples

Content

This wikiHow teaches you how to check the connection between a Linux computer and another computer using the command "ping". You can also use an enhanced version of the "ping" command "traceroute" to see which different IP addresses the requested computer is routed to in order to reach another computer address.

Steps

Method 1 of 2: Use the ping command

  1. Open Terminal on your computer. Click or double-click on the Terminal application with a black frame icon with a white "> _" symbol inside it, or you can press a key combination Ctrl+Alt+T.

  2. Enter the command "ping". Import ping along with the website or IP address on which you want to test the connection.
    • For example, to check the connection between Facebook and your computer, you need to enter ping www.facebook.com.

  3. Press ↵ Enter. The "ping" command will be executed and the request will begin sending to the specified address.
  4. See ping speed. To the right of each line are numbers in "ms"; this is the number of milliseconds that the target computer needs to respond to your data request.
    • The smaller the number of seconds, the faster the connection between the current computer and another computer / website.
    • When you ping the web address on the Terminal, the second line will display the IP address of the website you are testing. You can use this to ping websites instead of IP addresses.

  5. Stop the ping process. The command "ping" will run indefinitely; To stop, press Ctrl+C. This will stop the command and display the ping results below the line "^ C".
    • To see the average time it takes another computer to respond, look for the number after the first slash (/) in the line below "# packets transmitted, # received".
    advertisement

Method 2 of 2: Use the traceroute command

  1. Open Terminal on your computer. Click or double-click on the Terminal application with a black frame icon with a white "> _" symbol inside it, or press a key combination Ctrl+Alt+T.
  2. Enter the command "traceroute". Import Traceroute along with the IP address or website you want to visit.
    • For example, to trace the route from your router to the Facebook server we need to enter traceroute www.facebook.com.
  3. Press ↵ Enter. The "traceroute" command will be executed.
  4. See the route you requested. To the left of each line appears the IP address of the router through which your tracing request is being processed. You will also see the number of milliseconds the process takes to happen on the right side of the line.
    • If an asterisk appears in one of the routes, the server to which the computer is trying to connect has timed out, in which case another address will be tried.
    • The traceroute command will time out after reaching the destination.
    advertisement

Advice

  • The command "ping" as shown in this article can also be used verbatim on Command Prompt (Windows) and Terminal (Mac).

Warning

  • Not all websites allow us to ping their real address, so the ping results sometimes are inaccurate.