3 w3 j$ D( {+ g/ _: f8 u2 t" ~ n, Q r -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. % F) f. O$ g3 B/ u
, }) X0 u9 Z! ]! Q M+ u
不停的ping地方主机,直到你按下Control-C。 . F$ N: `+ J Q# u* w , j4 V& }+ v4 d) s; Z
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 S. U) k0 Y% z k' F8 J* q3 g8 n
$ [5 g" n/ S0 x+ l -a Resolve addresses to hostnames. 6 R. j- |. {: {& K
1 |7 k4 D/ m, g- M+ [
解析计算机NetBios名。 2 _6 F: d7 ^& p" m2 B 4 c" e5 ^+ t2 M; N4 N; w' L. w6 |
示例:C:\>ping -a 192.168.1.21 . q; m( q3 e' Q : ?( V0 z' ?8 c( r9 ^6 q( Q8 |: r( f
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 8 {( m" h. @/ ?; [4 X7 X& y H5 p* \$ L' u9 J& ]5 f/ X
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - E$ k% j* G3 T2 ?) W3 D3 @
+ i: i9 S4 I% H4 I+ Z+ K+ r4 B$ r Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , `9 l/ N8 H" H) b
6 f* u9 L; t. Z; D Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 ~! i+ Z) [" M0 t# L; G
! M- J) s7 y9 U) a# q Ping statistics for 192.168.1.21: 1 b9 d( [# [ J6 [7 O) Y
5 c! `6 ]0 s3 m
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 q% k7 N. H: r' K4 H. i
: e# o0 K( j7 n; a Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 _' S: G, l% ]8 x$ `
3 p! h4 o# D. f+ ?
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 ]4 z1 @5 t9 A/ Z
7 U! I" P& _6 F- _5 k -n count Number of echo requests to send. 6 ^1 E6 _8 s- K" J9 C) D
' \% O% N/ d$ ]! Z# e9 |% V
发送count指定的Echo数据包数。 ! O: H0 A- z' O. ^/ l
$ z' F6 x$ H; K# B, B t) v: V 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 7 r) J! L" X9 h2 Y
: N% |7 T$ C6 f( X) y" w
C:\>ping -n 50 202.103.96.68 ! m5 I: i1 y3 Z. P* @
' [8 Q2 t+ E: |2 R
Pinging 202.103.96.68 with 32 bytes of data: " n3 W d4 H$ J! c" N" f$ w
! ], z# t, D2 C1 B) G. c
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! [2 q* m+ X1 W& W! h+ U' Q 1 M. K( t' n- d" p- n Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - ?8 m6 I2 [3 P. v7 K 9 a4 |. n2 \- _9 f( o Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 ^, E4 m, d0 j- M) D+ O- s
' S: ^' J8 a* |# U# k7 t$ D
Request timed out. 3 \7 n7 l" D% {6 K9 e+ j/ [ 2 `8 y! V3 F1 w
……………… , W- P, H* s) X& b; l# T! [7 J0 Y
2 j5 \" j' z/ X6 v2 m8 h9 ?
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 O1 l1 ]9 B8 B6 u6 [' n! a
( \ {0 m3 L ~. g8 e Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) S; L1 f8 M2 f+ ^: H+ G ( B3 W+ u% w. V Y1 A+ @0 H6 q" E! b
Ping statistics for 202.103.96.68: 8 I( u k" j! @. j# s" m7 \% C# ~ ; A: l/ v/ q4 D3 n" l# N
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; U; i' M7 l2 A+ s0 }' ? / Y+ n( V: N$ e Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 ~0 Q: ^( a& j7 T& H: p ( k6 i) ~+ b6 P9 I# O" _ 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 I! q0 M; h8 A, U& d5 J( b4 T
7 |" x- {! O& t+ x; Y
-l size Send buffer size. # s" d' ], H4 v9 Y7 m
3 F; t t5 l: P+ B2 A4 V3 R1 k+ Z; o 定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54