ping
Check whether a host is reachable
What it does
ping sends a host small packets and waits for replies. Each reply prints the time in milliseconds, and at the end comes a summary of how many packets were lost. On Linux, without -c it keeps going until you stop it with Ctrl+C.
ping 8.8.8.8 checks that the server has internet access, and ping example.com also that DNS works. Some servers ignore ping on purpose, so silence does not always mean the host is down.
Syntax
ping <host>
ping -c <count> <host>Examples
Check the connection to 8.8.8.8 by sending 4 packets
ping -c 4 8.8.8.8ping— check whether a host answers-c 4— four times, then stop8.8.8.8— the address