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 www.example.com

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

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

# 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 www.example.com

# Audible ping
ping -a www.example.com

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

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

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

# 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 www.example.com

# 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 192.168.1.63

##
# More ping examples...
# http://www.thegeekstuff.com/2009/11/ping-tutorial-13-effective-ping-command-examples/
##