Files
tldr/pages.zh/common/ping.md
T
2026-04-01 11:19:25 +03:00

34 lines
884 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ping
> 向网络主机发送 ICMP (ECHO_REQUEST) 数据包。
> 另请参阅:`mtr`。
> 更多信息:<https://manned.org/ping>。
- Ping 主机:
`ping {{主机地址}}`
- 仅 Ping 主机特定次数:
`ping -c {{次数}} {{主机地址}}`
- Ping 主机,指定请求之间的间隔(以秒为单位)(默认为 1 秒):
`ping -i {{间隔秒数}} {{主机地址}}`
- Ping 主机而不尝试查找地址的符号名称:
`ping -n {{主机地址}}`
- Ping 主机并在收到数据包时响铃(如果您的终端支持):
`ping -a {{主机地址}}`
- 如果没有收到响应,也显示一条消息:
`ping -O {{主机地址}}`
- Ping 主机,指定 ping 次数、每个数据包的响应超时 (`-W`)和整个 ping 运行的总时间限制 (`-w`)
`ping -c {{次数}} -W {{响应超时秒数}} -w {{总的等待超时秒数}} {{主机地址}}`