Skip to main content

If you are having connectivity problems, you can use the ping command to check the destination IP address you want to reach and record the results. The ping command displays whether the destination responded and how long it took to receive a reply. If there is an error in the delivery to the destination, the ping command displays an error message.

# ping a host to see whether it's available:
ping -o

# ping a host with a total count of 15 packets overall.
ping -c 15

# ping a host with a total count of 15 packets overall, one every .5 seconds (faster ping).
ping -c 15 -i .5

# Check whether the local network interface is up and running:
ping 0

# Flood the network. Super users can send hundred or more packets per second
# using -f option. It prints a ‘.’ when a packet is sent, and a backspace is
# printed when a packet is received.
sudo ping -f

# Audible ping
ping -a

# Identify the ip-address using the host name.
ping -c 1

# Print only ping command summary statistics.
ping -c 5 -q

# Change the default packet size from 56 to 100.
ping -s 100

# ping for 5 seconds. i.e ping command will exit after 5 seconds irrespective of
# how many packets are sent or received.
ping -w 5

# Record and print route of how ECHO_REQUEST sent and ECHO_REPLY received
# It records, and prints the network route through which the packet is sent and
# received. This is useful for network engineers who wish to know how the packet
# is sent and received.
ping -R

# More ping examples...