• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

ping Command Examples in Linux

by admin

The ping command is a tool for testing connectivity between two devices on a network. It works by sending a series of Internet Control Message Protocol (ICMP) echo request packets to a specified destination host and waiting for a reply. The ping command can be used to check whether a network connection is working properly, to troubleshoot network issues, or to measure the round-trip time (RTT) for packets to travel between two devices.

To use the ping command, open a terminal window and type ping followed by the destination hostname or IP address. For example:

# ping google.com

This will send ICMP echo request packets to Google’s servers and display the results, which include the RTT for each packet and the percentage of packets that were lost. You can also specify the number of packets to send and the size of the packets using the -c and -s options, respectively. For example:

# ping -c 5 -s 1000 google.com

This will send 5 packets with a size of 1000 bytes each to Google’s servers.

You can use the ping command to test connectivity to any host on the Internet, as well as to other devices on your local network. Just be aware that some hosts may block ICMP traffic or rate-limit responses to ping requests.

ping Command Examples

1. To send ICMP request to mentioned host:

# ping 192.168.200.10 

2. To have the audible ping:

# ping -a 192.168.200.10 

3. To ping for particular number of counts:

# ping -c 10 192.168.27.100 

4. For flood ping:

# ping -f 192.168.27.100 

5. To set the interval:

# ping -i 10 192.168.27.100 

6. To ping particular iterface:

# ping -I eth0 192.168.27.100 

7. To sent specified number of packets without waiting for reply:

# ping -l 10 192.168.27.100 

8. To get the numerical output only:

# ping -n 192.168.27.100 

9. To suppress the output:

# ping -q 

10. To record the route:

# ping -R 

11. To bypass the routing table:

# ping -r 

12. To specifies the number of data bytes to be sent:

# ping -s 1024  

13. To set the IP Time to Live:

# ping -t 10 

14. To Set special IP timestamp options:

# ping -T 

15. To Select Path MTU Discovery strategy:

# ping -M hint 

16. To Print full user-to-user latency:

# ping -U 

17. To to set to verbose mode:

# ping -v 

18. To show the version info:

# ping -V 

19. To set the timeout:

# ping -w 10 

20. To time to wait for a response:

# ping -W 10 

Filed Under: Linux

Some more articles you might also be interested in …

  1. minicom Command Examples in Linux
  2. Running repairs on XFS Filesystems
  3. How to Clone Linux disk partition over network using dd
  4. guix package Command Examples in Linux
  5. filefrag Command Examples in Linux
  6. CentOS / RHEL 7 : Unable To Start The Samba Service
  7. ltrace: command not found
  8. dnstracer Command Examples in Linux
  9. CentOS / RHEL 6 : How to change the verbosity of debug logs during booting
  10. CentOS / RHEL : How to add new swap partition

You May Also Like

Primary Sidebar

Recent Posts

  • protonvpn-cli Command Examples in Linux
  • protonvpn-cli connect Command Examples
  • procs Command Examples in Linux
  • prlimit: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright