Online Linux Terminal Logo
OnlineLinuxTerminal
Networking & TransferCLI Reference

$ping

Send ICMP ECHO_REQUEST to network hosts to test connectivity and latency.

Syntax DefinitionPOSIX standard
ping [OPTIONS] DESTINATION
Linux Community2.4k Online

Chat with real Linux users, learn new commands & get free cheat sheet PDFs.

Try `ping` Live in Interactive Sandbox

Zero-install client simulation with real-time feedback.

Open in Fullscreen Workspace↗
bash — terminal

Overview & How ping Works

`ping` is the fundamental network diagnostics tool used to verify whether a remote host or IP address is reachable across an IP network. It measures the round-trip time (RTT) for packets sent from the local machine to a destination and reports packet loss percentages.

Common Flags & Command Options

Flag / OptionDescription
-c [count]Stop sending ECHO_REQUEST packets after count packets are sent.
-i [interval]Wait interval seconds between sending each packet (default 1s).
-W [timeout]Time to wait for a response in seconds before timing out.

Practical Real-World Examples

Example #1Ping a host with limited count
ping -c 4 onlinelinuxterminal.com

Sends exactly 4 ICMP packets to test network latency and packet loss.

Sample Output:
PING onlinelinuxterminal.com (104.21.72.10): 56 data bytes 64 bytes from 104.21.72.10: icmp_seq=0 ttl=58 time=12.4 ms 64 bytes from 104.21.72.10: icmp_seq=1 ttl=58 time=11.8 ms --- onlinelinuxterminal.com ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss

Frequently Asked Questions

Why does ping run indefinitely on Linux?

By default, Linux `ping` continues until you interrupt it with `Ctrl + C`, or specify `-c [count]`.