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

Related commands

Practise · All commands