2019-03-13 03:30:26 +00:00
|
|
|
# ping
|
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
> 向网络主机发送 ICMP 回显请求数据包。
|
2024-01-31 10:20:27 +00:00
|
|
|
> 更多信息:<https://keith.github.io/xcode-man-pages/ping.8.html>.
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- Ping 指定的主机:
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
`ping "{{主机}}"`
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- 对主机执行指定定次数的 ping 操作:
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
`ping -c {{次数}} "{{主机}}"`
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2023-06-13 13:34:40 +01:00
|
|
|
- Ping `主机` , 指定请求之间的间隔(以`秒`为单位)(默认为 1 秒):
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
`ping -i {{秒}} "{{主机}}"`
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2021-08-02 09:41:09 +01:00
|
|
|
- Ping `主机`, 但不尝试查找地址的符号名:
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
`ping -n "{{主机}}"`
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2023-06-13 13:34:40 +01:00
|
|
|
- Ping `主机` 并在收到数据包时响铃(如果您的终端支持):
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
`ping -a "{{主机}}"`
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2023-06-13 13:34:40 +01:00
|
|
|
- Ping `主机` 并打印接收数据包的时间(此选项是 Apple 的附加项):
|
2019-03-13 03:30:26 +00:00
|
|
|
|
2024-01-01 09:38:53 +00:00
|
|
|
`ping --apple-time "{{主机}}"`
|