ping—reports if a remote system is reachable and alive

ping [-dfnqrvR] [-c count] [-i wait] [-l preload] [-p pattern]
   [-s packetsize]

ping sends ICMP ECHO_REQUEST packets to a host machine and waits for a response to tell you if the host or gateway is reachable and alive. It is used to track down network connectivity problems. If ping does not receive any reply packets at all it will exit with code 1. On error it exits with code 2. Otherwise it exits with code 0. This makes it possible to use the exit code to see if a host is alive or not.

This program is intended for use in network testing, measurement, and management. Because of the load it can impose on the network, it is unwise to use ping during normal operations or from automated scripts. ...

Get Linux Shells by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.