Online Linux Terminal Logo
OnlineLinuxTerminal
网络与传输CLI Manual

$ping

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

命令语法POSIX Standard
ping [OPTIONS] DESTINATION
Linux 社区2.4k 在线

与真实 Linux 用户交流,学习常用命令并免费获取精美速查表 PDF。

在交互式终端沙盒中实时运行

无需安装的客户端实时仿真环境。

在全屏终端工作区中打开 ↗
bash — terminal

概述与工作原理

`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.

常用参数与选项说明

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.

实际生产案例与代码范例

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

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