( m# u- }) O9 H# Y" O& y -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! ]: V& f) S3 N7 S. B- Q5 m* \# y5 y3 r 1 k/ a. T7 I$ G o9 N
不停的ping地方主机,直到你按下Control-C。 : q3 n& o1 A: y" M5 v; s 1 I. H; h( i. Q$ f9 B6 e 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " E8 _! ^' Y( a2 w% ?1 B; K
# N! h& M# s4 t# b -a Resolve addresses to hostnames. * ]( d& w7 T+ M2 n' Z/ d: o. @
) A6 ] D- p# p& Y% n) o 解析计算机NetBios名。 6 T% F k# O* O x) v
# c. w: I4 `9 Y. ` 示例:C:\>ping -a 192.168.1.21 ( ~1 |: N, s. ?& C
1 z9 T9 e4 s' F2 b9 A
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 9 t5 w. ^" H& F' a+ L
* G3 R& D2 E* a( c8 h* p
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - Z0 {3 y7 \" b# g. k# A
3 K! ~/ V! |/ |$ k% m) Z, I Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 X0 s5 i6 A0 j. c
V3 X- |" s8 X- i1 l4 v
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + R9 }; E4 y* j& S# ]7 E y2 l0 J& G* ]
' u& G7 V( T7 @* i, ~! S1 V4 _
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " E! q4 N: N% q( @" w! \
8 T4 k! \; h; `
Ping statistics for 192.168.1.21: ( o! @2 `! B8 m" z2 t, m2 f . R5 s# o- e; x$ G, R- X! N2 ?
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 5 H6 U( X" w4 L2 O' M0 L& M ; }$ P5 ~% f" C3 E, ? D$ S
Minimum = 0ms, Maximum = 0ms, Average = 0ms - I3 P2 X' O: B& C; W$ t0 ` 7 S/ F) V- E4 v 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 W1 i2 w1 {4 A' \) q! _" ] 8 n" u3 L" W! T u' O -n count Number of echo requests to send. : G+ c- {% n# B6 [ 8 t5 e. u3 C8 R& y) Z 发送count指定的Echo数据包数。 3 N; E2 U+ o8 y5 f/ r# H% H- O / m! x+ g- @1 o m 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: + X9 m* u0 I- e% R% N& r4 N& } ! `7 R* H% k# q; O. ~+ J @* ]+ E C:\>ping -n 50 202.103.96.68 ' u. |: n8 J) i$ I
5 ~9 q0 b# b5 E: O) H; ?% V, _3 R3 L Pinging 202.103.96.68 with 32 bytes of data: $ b9 ~) z4 m( c
7 t8 v& o0 d ?
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; V4 \! f8 F! w# Q 6 u" T( u, h. ]. v7 j3 o+ J/ F c Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / m/ X, Y& J( P! ~
5 w; d# O- P3 p Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 [$ _! V$ H& h( _" F" C $ I& M+ g5 s( ^ y3 y1 `$ { Request timed out. - N$ a% ^1 o3 Q9 R: L; q ! _/ y4 q8 l3 a X+ ~. a3 w5 H ……………… $ f- U: v: n+ W& b O " L2 \2 ~6 t4 P( L" v Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 t$ u) I4 H, ^1 j) c# u ( N2 H9 J% I. _- o' Y& ?9 H. B; \5 j
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' j! n) ^% K3 D6 F0 X3 w0 u6 }7 u 0 d; j2 u' B" Y v# u8 `) s Ping statistics for 202.103.96.68: , g/ a$ z5 k- Y' Z) p ' f8 f1 G2 S8 i! d& H" B Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 7 s: b' A. ~6 ^. B$ Q) [1 ?5 H- q) N
% b4 v2 U% y. R% {8 v5 p0 K Minimum = 40ms, Maximum = 51ms, Average = 46ms % R0 ~% `# Y3 }. f9 H" u9 z % n3 H- G" u, r9 m7 y4 i: n8 s
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 5 t7 q/ a7 m2 x6 t' R