Ping is available in Windows, Linux, and MacOS as a dia­gnostics tool for network con­nec­tions. In our article on ping command basics, we already in­tro­duced you to the command line program’s functions. To com­ple­ment this, we’ll show you below how you can use ping for con­tinu­ous tests.

Con­tinu­ous ping in Windows 7, 8, and 10

In Windows, the ping sends four data packets in its default setting to the target computer you specified by IP address or host name. If you would like to test the network con­nec­tion between two computers on an ongoing basis, the “con­tinu­ous ping” option is available.

Follow these in­struc­tions to run ping in Windows 7, 8, or 10 as a con­tinu­ous test.

Step 1: Open the Windows command prompt. One way of doing this is by entering the key com­bin­a­tion Windows + R and enter the command CMD.

Step 2: Enter the command line ping with the -t option and any address and confirm by clicking [Enter].

Cheap domain names – buy yours now
  • Free website pro­tec­tion with SSL Wildcard included
  • Free private re­gis­tra­tion for greater privacy
  • Free Domain Connect for easy DNS setup
ping -t 93.184.216.34

Windows runs the command line program as a con­tinu­ous ping in an endless loop.

For each incoming response packet, ping issues an entry on the standard output (stdout). Provided that you haven’t added any other settings, the in­form­a­tion will be recorded directly into the terminal. The output comprises the IP address of the pinged computer, the size (in bytes) of the response packet, the response time in mil­li­seconds (ms) as well as the TTL (Time to live).

The echo queries are dis­patched every second to the target computer until you end the command line program with [Ctrl] + [C].

If you stop the ping, the program displays a stat­ist­ic­al summary (ping stat­ist­ics) at its con­clu­sion.

If needed, you can redirect the standard output to a text file. To do so, you add the ap­pro­pri­ate operator (the greater-than symbol) as well as the file name (including the extension).

ping -t 93.184.216.34 > logfile.txt

If no file is found under the specified file name, it will be auto­mat­ic­ally generated. In the example presented above, we redirect the standard output to a txt file named logfile.

Both the in­form­a­tion on the incoming data packets and the ping stat­ist­ics will be recorded in the text file you have specified.

Tip

You’ll find an overview of the most important CMD commands in our article on the basics of the Windows command prompt.

Con­tinu­ous ping in Linux

In Linux, the ping command line program is already run on an endless loop in the default setting. Follow the in­struc­tions below to perform a con­tinu­ous ping test in a Linux system.

Step 1: Open the terminal for your Linux dis­tri­bu­tion in Ubuntu. One way to do this is with the key com­bin­a­tion [Ctrl] + [Alt] + [T] (Genome, KDE).

Step 2: Enter the ping command and the target computer’s address in the command line and confirm by hitting [Enter].

ping 93.184.216.34

In Linux, the re­dir­ec­tion of the standard output to a text file occurs according to the same syntax as that used in Windows.

ping 93.184.216.34 > logfile.txt

If you’d like to have the con­tinu­ous ping issue a timestamp, use ping with the -D option. In this case, the output for each incoming response packet is preceded by a UNIX timestamp.

ping -D 93.184.216.34 > logfile.txt

If you don’t want to run ping on an endless loop in Linux, define the ping quantity with the -c option according to the following example.

Ping -c 4 93.184.216.34

The target computer with the IP address 93.184.216.34 is pinged exactly four times before the program ter­min­ates itself.

Tip

We provide an overview of the most important Linux commands in our article on the Linux terminal.

Con­tinu­ous ping in MacOS

In MacOS, the ping command line program is also run as a con­tinu­ous ping in the default setting.

Follow the in­struc­tions below to run ping in MacOS as a con­tinu­ous test:

Step 1: Open the terminal. You’ll find the Mac terminal under “Ap­plic­a­tions” in the subfolder “Utilities”.

Step 2: Run the ping command with the address of the target computer.

ping 93.184.216.34

In MacOS, you redirect the standard output according to the same procedure you would use in Linux and Windows.

ping 93.184.216.34 > logfile.txt

Run a ping test as you would in Linux with a user-defined quantity of echo request queries by choosing option -c.

Ping -c 4 93.184.216.34
Note

You’ll find further in­form­a­tion on ping command in Windows, Linux and MacOS in your operating system’s manual. Enter the command man ping in the terminal in order to open the manual page for the cor­res­pond­ing command line.

Go to Main Menu