$ b: B) L0 C& I. y3 L; y6 d Options: 4 y3 }( I" D2 G; _1 _4 k. F
: u- T3 q3 M& @- k: K- V -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. * a- V' N- b8 {" l5 ]! f
1 v0 D4 A, k9 {3 T2 T# t5 ^6 g
不停的ping地方主机,直到你按下Control-C。 ) J) g K. x& Y3 g( ~* R! S( k1 c 6 T4 m l( \+ R" h! U2 a
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 - z0 b; p2 _- s, K o; ^% M ; y( l$ }; K; o3 R9 S -a Resolve addresses to hostnames. 2 U, {% f0 z4 w2 |6 p* ]6 _1 j
" O1 R) { s' L8 C+ H m& Q
解析计算机NetBios名。 + p! n8 B/ n% J- \, Y, S - K5 ]( U4 F5 l& v9 X; k8 h 示例:C:\>ping -a 192.168.1.21 0 n% R* V4 q+ [' i 3 k: _8 }# [% n+ I* V1 n7 q Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: * W" z. d2 y# Y8 }' a4 c# g 9 u; n5 y. j' ]$ `0 d Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + Y' p1 f4 D' Q" g5 N' E) X
$ T9 D* [9 U3 o6 O) I
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 Z) s! U; n2 b/ M& x! d3 l
$ L' M7 K0 m4 t+ r ? Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 H. k( v. `. p/ a; ]- K: W6 c9 o' ]% D* g
& x( [1 Y5 q7 Z q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : o4 v& {" g% m+ ^* g Q! k" z
# O6 e- a) D i! O Ping statistics for 192.168.1.21: ( r! B$ i4 y$ V) D+ J; }
1 o; m3 p( ?6 o5 \. g- y
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: # h% U) \5 P& v& r g q
/ u# Y/ x+ Q' Z) {/ i+ B 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 @* O; K6 x5 N, p , Y7 P/ b0 m( H: F0 w
-n count Number of echo requests to send. % C& Z# _5 e4 I5 W6 L/ J ' o" Y, a+ ]8 Y3 C9 R' n$ A
发送count指定的Echo数据包数。 h/ Z* Q B9 h2 G ; s! P+ T+ _! C6 I/ m0 N+ J1 x! Q
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 8 _* t- c; E, G, H + I# J, b" |6 o9 _0 v; H
C:\>ping -n 50 202.103.96.68 ' w" D, ~4 s! k+ Q6 W
) G+ U2 n; k1 I/ v
Pinging 202.103.96.68 with 32 bytes of data: 4 r5 e1 L: g/ v* C \; t * O8 ] P+ B% k Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 D6 m. q8 R& D& d
: p2 g/ {( t4 k
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 F8 s) p; x. ^1 ^0 B7 X) @1 z9 e4 ] + [5 m$ ]- O" S0 r Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " g, @/ J1 g+ f2 D4 K4 j) M2 I ! a- L/ z( y ^; c9 b Request timed out. ' I# {8 I/ q0 d9 t$ Y/ ~
# z, k5 @, G5 V9 t7 T
……………… # R" T+ p" f. ^: n. {) d5 b b* x. G {$ e" i; }. e
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # f4 ] w; Q' |4 I' E + i1 J5 B- l- T9 E
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 r* V, b s+ c6 M" c8 X : Y; X6 F* x. ~% |& b2 C! F Ping statistics for 202.103.96.68: ; K9 j9 Z9 s8 \2 Y- V" A7 }1 G
+ m. o) u, d' p8 | Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; c3 t3 N6 c3 F5 Y, l7 f/ ~ + K8 ]7 o$ \! N# b( j6 \, f) v
Minimum = 40ms, Maximum = 51ms, Average = 46ms / p+ k2 E+ N: c# w9 w o
8 w: ~2 _& s2 r8 t$ O5 P' o 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ' x/ v X# C' V ?' c0 V; j4 m 2 Y8 M: T/ I7 u1 L; D0 e -l size Send buffer size. & I3 e# ]! k7 l5 f# V$ ~& x6 O) j