2 f" W& O6 S6 h1 Z2 H -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 L9 `" U: y: C& \' M; ]1 E
, P9 e, x, K1 l+ X! T2 T 不停的ping地方主机,直到你按下Control-C。 9 f0 P: Q2 X: Z7 V- u3 w9 Z $ {, e1 g% S; V& z, U 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( e( D2 u5 k8 H! j' p$ D7 ]. U ; ]8 s- Q6 o. o q [! Q -a Resolve addresses to hostnames. . D7 Q, Z) ^2 t' K3 e, P
7 I8 w3 }/ L8 P& o- H {1 g9 K8 g 解析计算机NetBios名。 2 S7 d% H1 W9 W# b6 j" p0 T- y/ v
3 N/ r$ W7 g1 I/ x" a3 m
示例:C:\>ping -a 192.168.1.21 0 h- B: q# |- ^ R4 Y; O
L& W. w/ V1 B4 Y1 d. A3 ~) s Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ' n* D$ U' w6 p' ~% u ) N& b7 V' n2 Y% E% i
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! I( }( K: X8 ]5 T" e4 Q; V
3 }# {( t7 ^6 U! }8 W- F9 z4 {
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 q6 r& l* f& B6 M! f" S/ Y/ _
$ z1 P9 A. R( S. E' B4 F: O) ? Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & g+ s; G: f+ ~7 u U9 d
# ?( l/ }- Z4 W7 R 8 }& u+ X& f6 \4 W( Q, ~ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( j+ H) |( [; J
/ w, B x* F% ~. D% Y$ O
Ping statistics for 192.168.1.21: 4 f5 a7 {* ^5 _+ f% f + v, h# G( d$ ` Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 8 F; J9 q( f7 p& @ & q1 |; Z$ J1 ]. X. R7 h Minimum = 0ms, Maximum = 0ms, Average = 0ms " h* Y, [) Z- d* w9 d
& F1 {% L" C$ K0 l* v2 u' ?; d5 m( ] 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ! c/ l6 S2 X/ ?" v6 f ! [& ~$ D0 {' k' x* @0 K
-n count Number of echo requests to send. 0 R* t9 K7 d9 Y r/ [4 J: v9 ~ b& Z
" M: _9 T# I9 |0 P2 o( p4 E* D
发送count指定的Echo数据包数。 4 [+ d& O; T4 W7 O; s5 X- m6 p " z! Z6 u0 N& N- i
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 6 o K) I/ c/ m' @8 x" w. Y- B . z* p. D9 o" n# T* w+ Z& j1 y C:\>ping -n 50 202.103.96.68 & Y" h" f8 z9 g$ `) m; ~2 H ) A# i/ l, c1 p2 s1 I Pinging 202.103.96.68 with 32 bytes of data: 0 K- Q2 X9 `: p* F8 q3 ~ K5 g' z1 I : F; n+ _; a! R5 a
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % l8 R; Z8 M" `! J* J1 [! W' g * D) Z; m" C5 A4 L! h, @6 l# l9 r Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & d8 O0 k- }( T% b8 ?: {' R7 L u* ~; U1 q' y* D! Q4 y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 `+ v0 o8 ?/ K+ ^5 ^- _ 4 f7 t* ?, W9 v |
Request timed out. # |) j6 L1 g. ^4 e
1 z6 ?8 S6 h2 O: n) J0 [ ……………… . W. b$ M" a; _: X5 Z $ r0 l6 V# ?( ` h5 j. c. R+ P
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " [* p+ ?0 x( K o) w) ~ 1 N5 b3 i' n- t+ G* u2 A+ \$ f! f
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) U6 z9 x4 h- {# m& F) H" [
1 Z6 c2 P3 G# z3 P+ ^ Ping statistics for 202.103.96.68: ( `/ W! M: k5 R0 b
2 e+ B" y/ v) ^% F/ d+ a Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: % y# U+ r2 ?, M- V - V) S6 x0 ?7 I3 l, i |* B6 J Minimum = 40ms, Maximum = 51ms, Average = 46ms 6 }4 F7 o1 V( N( K G4 C ; x( ]$ m& K+ k' Q. k' n
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 2 V! Z2 [# T) r6 w" W, \ ) R6 M6 E% k6 o; [- v -l size Send buffer size. ' A# K0 r0 g/ U8 S5 {1 \0 l % [7 |4 [- f8 T" o. C
定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54