1 E2 g, R: ]4 a* u Options: / x( C- ]/ G% b) L% p3 w8 {
; P4 [+ E0 g8 u2 f1 g5 g% t
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 4 l1 ~# Z) V! R4 Z2 z: { ( w. j, N/ R( [* U/ J) U
不停的ping地方主机,直到你按下Control-C。 9 M& a5 n8 j' E: o/ |
0 Z- ^0 {# P2 N# @+ m
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 + y* X2 ]& E* U/ G
0 H, S( Z7 C: d8 |
-a Resolve addresses to hostnames. . R2 X9 u y, P' P$ U" e" _ ( l# ~6 V/ Q- t! A( F0 {
解析计算机NetBios名。 : _, a$ E+ m" m0 R$ C1 g 6 B7 t$ q$ _+ N3 d$ I
示例:C:\>ping -a 192.168.1.21 ( X, T- Y! B( E. {5 x I: W6 ]. X
K" W* B4 b: G1 @ Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 3 O9 p- V* N" m# y' {
+ B9 w1 B1 b/ C. B( \; ?
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 l) A4 N" }7 [& {' @& w$ _1 K2 ?3 j # ?& X7 x2 y. q( Z" r, x4 o Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 m; w5 k# C0 V3 {7 Y- l1 k( `5 M " p& {+ q+ {) W5 b5 { Y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * c% b0 w7 V- L* R4 x9 K
' Z$ D2 P# e% b/ G: U , O" t0 ~6 W0 Y* M0 M
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 _2 c. G+ C9 {# n9 t9 t
: `* \- I4 K+ y. s6 y
Ping statistics for 192.168.1.21: ) {5 L0 Q7 n% B6 w; ~ 3 I& @5 B. x/ ^8 r- A7 y Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: V0 G: ~% l' Z& Q/ z
8 |! ]& a$ z2 w7 b( G3 d# {* T8 y0 ^ Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 b9 l8 o Z" j+ R5 D
2 I/ p& r5 H1 r) V0 k5 C
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 : K# g/ o! C5 K" I4 \5 E. \% S
5 f3 V9 s* t& M: r* p# c
-n count Number of echo requests to send. & n0 q! ?$ x9 u& O. t) Y) K* z - f" A3 a4 C8 u# P& ? 发送count指定的Echo数据包数。 * }7 b0 _6 j, V8 X( J8 b0 _
0 H; \7 Y# p$ Q0 N; j
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ( i+ A% Z7 r* j( a
$ B2 X4 F7 H. m2 z; m# W C:\>ping -n 50 202.103.96.68 5 ]6 v6 o2 u3 O- s7 l" s + n/ p: r% G0 D) E' q
Pinging 202.103.96.68 with 32 bytes of data: $ U. W8 u0 p* y* C6 H2 |5 K 5 h1 d' U8 v/ T0 f' w
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! |9 m5 m% }% `% v* M" T4 x9 i
) C, w' e m% V5 f1 M- p# a Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 Z. t0 g6 z7 z2 ? 8 q' E7 w1 k( i
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + c4 _1 g9 J( j- i, r9 h! u W
+ |% [2 W; k" }1 Z5 d( b
Request timed out. $ t6 K& e2 s, L* v % h, I0 ~3 C) q$ q: I
……………… ' X2 ^, B# ~9 \: s$ Y& ?8 h4 ^ # }+ c& w. N. \- F Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . E+ S, R, h9 m1 m# W! P * T6 [# ^% T, F- ^. } Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 u6 J; `8 q8 w% J 7 g' X' n* w+ v
Ping statistics for 202.103.96.68: $ W' I8 f$ C9 N1 Y" p6 r8 G4 Z' g* |3 v ; m. W4 v( Y2 W9 p) e" i( X Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: # `2 \: P- s) }% ]
) F5 Q; A: {& d, t, D
Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 M! G8 I/ V1 g$ N. c
+ C: ~: k8 N2 p: j
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ' ?, J4 o& M2 { h* e7 E j * J" m+ X6 R( O -l size Send buffer size. : v% N6 I3 T" ^" X/ T1 }& Y
" U8 I- K2 ^& N, s% D
定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54