How to Ping on Linux

Today's TipsMake will show you how to test the connection between a Linux computer and another computer using the 'ping' command. You can also use an advanced version of the 'ping' command called 'traceroute' to see which different IP addresses a computer requires to be routed to in order to reach another computer address.

Use the ping command

Picture 1 of How to Ping on Linux

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

Picture 2 of How to Ping on Linux

Enter the "ping" command. Enter pingalong with the website or IP address where you want to test the connection.

For example, to test the connection between Facebook and your computer, you need to enter ping www.facebook.com.

Picture 3 of How to Ping on Linux

Press ↵ Enter. The "ping" command will be executed and begin sending requests to the specific address.

Picture 4 of How to Ping on Linux

See ping speed. To the right of each line appear numbers with "ms" units; this is the number of milliseconds it takes the target computer to respond to your data request.

The smaller the number of seconds, the faster the connection speed between the current computer and another computer/website.

When you ping a web address in Terminal, the second line will display the IP address of the website you are testing. You can take advantage of this to ping websites instead of IP addresses.

Picture 5 of How to Ping on Linux

Stop the ping process. The "ping" command will execute indefinitely; To stop, press Ctrl+ C. This will stop the command and display the ping results below the "^C" line.

To see the average time it takes another computer to respond, look at the number after the first slash (/) in the line below "# packets transmitted, # received".

Use the traceroute command

Picture 6 of How to Ping on Linux

Open Terminal on your computer. Click or double-click the Terminal app icon with a black frame with a white ">_" symbol inside, or press Ctrl+ Alt+ T.

Picture 7 of How to Ping on Linux

Enter the command "traceroute". Enter traceroutealong with the IP address or website you want to track.

For example, to trace the route from your router to the Facebook server, we need to enter traceroute www.facebook.com.

Picture 8 of How to Ping on Linux

Press ↵ Enter. The "traceroute" command will be executed.

Picture 9 of How to Ping on Linux

View the route you requested. To the left of each line that appears is the IP address of the router through which your tracing request is processed. You'll also see the number of milliseconds the process took to happen to the right of the line.

If an asterisk appears in one of the routes, it means that the server to which the computer intended to connect has timed out, in which case another address will be tried.

The traceroute command will time out after reaching the destination.

Update 26 October 2023
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile