Tools & Commands · Linux and Windows Commands
ping
Connectivity · Beginner
Sends an echo request to a host and reports whether an echo reply returns, along with the round-trip time. It checks basic reachability, not application health.
If you get a reply, the host answered a basic diagnostic message. You still do not know whether a website, database, or login on that host is working.
Example: ping -c 4 192.0.2.1 on Linux, or ping -n 4 192.0.2.1 on Windows, sends four echo requests to a documentation address.
Command
Platform: Windows, Linux, and macOS
ping -c 4 192.0.2.1
Linux and macOS use -c for the count. Windows uses -n instead. Replies show round-trip time. Packet loss means some or all requests went unanswered.
4 packets transmitted, 4 received, 0% packet loss rtt min/avg/max = 10.1/11.4/12.8 ms
All four requests were answered. The average round trip was 11.4 milliseconds. This still says nothing about a web server on that host.
Common misconception
- A successful reply does not prove that a specific application port is open.