Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Facebook Twitter Instagram
Tech News Today
  • Hardware
    • Motherboards
    • CPUs
    • Graphic Cards
    • RAM
    • SSDs
    • Computer Cases
    • Monitors
    • Peripherals
    • Power Supply Unit
    • PC Builds
    • Computer Tips
  • Software
  • Operating System
    • Windows
    • Mac
    • Linux
  • Gaming
  • Mobile
  • Console
  • More
    • Internet
    • Networking
    • Security
    • Buyer’s Guide
    • Gadgets
    • Laptops
    • Reviews
    • How To
    • News
Tech News Today
Home»Networking»How to Ping an IP Address in Windows or Linux

How to Ping an IP Address in Windows or Linux

Nishant AryalBy Nishant AryalDecember 21, 2022
Ping-an-IP-Address

Ping is one of the most popular commands used in the networking world. Using this command, you can Ping an IP to troubleshoot network issues and check if the internet is working fine.

Moreover, pinging an IP address is very easy on Windows and Linux OS. The command lines used on both are almost similar.

In this article, we will walk you through the process of pinging an IP using the command-line functions on CMD, Powershell, and the Linux Terminal.

Table of Contents

  • How to Ping An IP Address on Windows?
    • Using CMD
    • Using PowerShell
  • How to Ping An IP Address on Linux?

How to Ping An IP Address on Windows?

To ping an IP Address on Windows, you must use Command Line Interface(CLI) tools like CMD and PowerShell. The process of pinging IP addresses is relatively easy. It requires you to execute some command lines with the desired IP address. If you are aware of the domain name (For instance, Google.com), you can also use it instead of the IP address.

Using CMD

CMD is the most commonly command-line interface to ping the IP address. Ping command line is used for it. You may use different variations to the ping command in a command prompt. You can see the list of ping options available by entering Ping in CMD.

9ER5OzbtEfe34de Ufxz7kY MS6JvOATldzhxpJsY 1KS43Lvcmcxbc2ZRaEhvZKqCO2nbyDpTo9jhl6V WLBKpHwLdIzO2m8MYfCLACMsRwtVLexmt4yNyG

To ping IP an IP using CMD, follow these steps,

  1. Press Windows Key + R. Type CMD and hit Enter.
  2. Now, execute this command to ping the IP address Ping 8.8.8.8  Ping 8.8.8.8
Note: For convenience, we have used 8.8.8.8 as the IP address in all of the ping commands. Replace it with your desired IP or the domain name (Example; ping Google.com)

Using PowerShell

You can also ping the IP address using Powershell too. Moreover, it can provide you with diverse ping outputs compared to the CMD. 

Here’s how to ping an IP using PowerShell,

  1. Open Run by pressing Windows Key + R. Type powershell and hit Enter.
  2. Now, enter Test-Connection 8.8.8.8. powershell test connection
    This will ping to the IP and give you the desired output.
  3. You can also ping multiple IP addresses using this command; Test-Connection 8.8.8.8, 1.1.1.1Test connection using PS

If you have many IPs to ping, you can do it in seconds using  PowerShell. Here is one such quick command line for you that lets you do it and save the output result in a text format as well. Just follow these instructions,

  1. Save the IP addresses in a notepad and save it (in .txt). In the command, the list is saved under the name List of IPs.txt. Similarly, the output log will be saved under the name pinglog.txt.List of IPs
  2. Open Powershell. 
  3. Paste this command. Replace the source (after the Get-consent line) and output file (In the outputfile line) directory in the command line and execute it. 
$ServerName = Get-Content "C:\Users\XYZ\OneDrive\Desktop\List of IPs.txt"
$outputfile = "C:\Users\XYZ\OneDrive\Desktop\pinglog.txt"

foreach ($Server in $ServerName)
{
    $date = get-date
    if (test-Connection -ComputerName $Server -Count 2 -Quiet )
    {   
        "$Server is Pinging | $date" | out-file $outputfile -Append
    }
    else
    {
        "$Server NOT pinging | $date" | Out-File $outputfile -Append
    }      
}
  1. A ping log will be saved to your device in the specified location. You will see if the IP is getting pinged or not. Export ping log using powershell

How to Ping An IP Address on Linux?

Similar to windows, Linux too has many ping options available for the users. It also requires you to enter the commands into the Linux Terminal. We will suggest you some useful command-line to ping IP addresses on Linux, which would work for all the distros. 

Here is how to do it:

  1. Open the Terminal by pressing Ctrl + Alt + T. 
  2. Type ping 8.8.8.8, and hit Enter. This will start the ping process. If you want to stop, it press Ctrl + C. 
  3. If you want to change the packet size for the ping, use this command, ping -s 4 8.8.8.8ping -s 4 8.8.8.8
    This command will only exchange 4 packets with the IP 8.8.8.8 for the process. Change the size in the command as per the requirement.
  4. Similarly, to limit the ping packets to a specified number, use ping -c 2 8.8.8.8. This will stop the packet transmission at 2. ping -c 2 8.8.8.8

There are Some other important ping options you can use.

Ping OptionsUse Case
Ping -i <n> <IP Address>Wait for ‘n’ seconds to send consecutive packets
Ping -c <n> -q <Ip Address>Get ping Summary
Ping -w <n> <IP Address>Stop ping after ‘n’ seconds
Ping -c <m> -w <n> <Ip Address>Set wait response time to ‘n’ for ‘m’ size of packets
how-to
Nishant Aryal
  • LinkedIn

Nishant is an enthusiast who loves writing about technology. He also is heavily invested in keeping himself updated about the latest happenings in the tech world. At Tech News Today, he covers Operating Systems, how-to-topics, and Fixes.

Related Posts

wifi-keeps-disconnecting-windows-11

Wi-Fi Keeps Disconnecting on Windows 11? 9 Ways to Fix It

February 26, 2023
windows-cannot-access-network-drive

Fix: Windows Cannot Access Network Drive

February 23, 2023
how to check wifi speed in laptop

3 Simple Ways to Check Wi-Fi Speed in Laptop

February 23, 2023
network_adapter_not_working

Network Adapter Not Working? 15 Ways to Fix It

February 22, 2023
Surface WiFi Not Working

Why is My Wi-Fi Not Working on Surface Laptop? 10 Ways to Fix It

February 22, 2023
change-network-profile-windows

4 Ways to Change Network Profile in Windows

February 22, 2023
Add A Comment

Leave A Reply Cancel Reply

Latest Posts
Memory-Compression

What is Memory Compression in Windows? Should You Enable or Disable It

March 1, 2023
dism-vs-sfc-vs-chdsk

DISM, SFC, CHKDSK: What’s the Difference

February 28, 2023
bios-settings-for-gaming

Best BIOS Settings for Gaming

February 16, 2023
You may also like
how-to-clean-hp-printer-rollers

How to Clean HP Printer Rollers

March 3, 2023
keyboard input lag

9 Ways to Fix Keyboard Input Lag

March 3, 2023
keyboard key is stuck

How to Fix a Stuck Key on a Keyboard

March 3, 2023
Recommended
Cookie Clicker Garden Guide

Cookie Clicker Garden Guide to Unlocking Every Seed

September 26, 2021
monitor no signal

Computer Turns On But Monitor Says No Signal (9 Ways To Fix)

November 10, 2022
Facebook Twitter Pinterest
  • Home
  • About Us
  • Our Team
  • Editorial Guidelines
  • Privacy Policy
  • Affiliate Disclosure
© 2023 TechNewsToday, editor@technewstoday.com | Tech Central Pvt. Ltd.

Type above and press Enter to search. Press Esc to cancel.