7 F3 Q7 {( `5 z/ {& @, U0 w' D Options: : I7 s/ ?- a: \0 D# M9 k " L- P: W: O" c
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. " Z) H8 n! [2 u ^$ z8 G0 J' v) D$ ^ 不停的ping地方主机,直到你按下Control-C。 3 m* r# C# K& M% z1 x# ~6 p* j ( U" O9 E: I1 I 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " v: f( B+ [' g+ C9 D- Y- A/ X0 u4 E % a6 o' o6 S# F1 {& x2 `
-a Resolve addresses to hostnames. 6 |2 E. e7 e/ A f
; U0 N( A- [$ s( R5 o% n5 Z1 A; H 解析计算机NetBios名。 - {- m, ~% g5 L1 }- p3 Z1 o
% H/ g/ q8 l/ @ 示例:C:\>ping -a 192.168.1.21 % o4 s, d; \( B0 x2 j6 }- c; T $ ^ e9 z% E* M( F+ h) K
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 2 |0 l& q( R. [" b& b$ `; D) ?+ i
+ ^- w2 U2 j: L. z) X Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & t2 D5 E- l1 q+ H1 I$ w 9 ~. @/ Y) e) I
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 J( n+ W) @" b7 g e
* P( _* Y C6 `4 r0 N Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 I2 ]! O, q* ^% K1 B
1 U, p* e; J) i9 \! [
7 o8 Q5 p6 g4 K5 S9 X- J3 C p
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ q! g/ u6 I, q9 I' }% \ + f( R3 m9 i$ L+ N" c5 ]% r Ping statistics for 192.168.1.21: 5 X D" X% Y% {: p. P
2 e# O7 W7 e! C# s5 S' b8 j
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ) Q3 q6 |1 C' [5 ]. P8 E
! I% j' l0 \4 l( i( q/ E Z2 l, U Minimum = 0ms, Maximum = 0ms, Average = 0ms + j9 O, d: k. `3 {9 n2 V! r
/ d5 ~1 Q: u7 j, l
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 7 Z7 r, t5 V* c4 q% v2 T 2 n( Q5 s' ~$ b1 S7 C -n count Number of echo requests to send. ) j2 i( \3 l! t$ ~; X * @! x1 U9 w. D) X- `1 N
发送count指定的Echo数据包数。 8 t; w/ l' R* w" w Q / I \3 X- f+ w/ \ 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: # I/ L9 T* {7 ?/ h 2 B9 c5 J# o* v$ G1 z& H3 A C:\>ping -n 50 202.103.96.68 2 m4 \. ^5 p& L3 c8 D; B* R9 r5 v" g
9 O( A b8 j2 |# e
Pinging 202.103.96.68 with 32 bytes of data: & M7 e" u' X5 i% G 3 G. y5 @9 b+ ] Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 `$ t! H7 ~) I2 G+ V9 U
( a2 U ]/ u5 {; d" j
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 O0 q# M+ s5 } ?, f + T9 B6 ~: y5 `1 H Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( a* b. U, s+ k# J & M" }+ d# Q8 j3 {, W- E* h' W
Request timed out. " H; V) b6 o0 e+ ]
) G& n; ]% h* o0 S* T
……………… % I. J) ]$ z- x1 I# K1 s
) C! W. x/ O+ I& o' X
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 H. S. l4 V6 H7 ]) L" H
3 s/ M; g' t [ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 q3 X8 {, L) k) z; Q M
: `' F0 s5 D/ r, t9 k Ping statistics for 202.103.96.68: 6 A" _( h# w' q5 B. O , @% Z8 s& t0 J H1 C! O Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 Z$ X. g. q, `8 v ' x4 f' B, i4 v: g7 h9 V Minimum = 40ms, Maximum = 51ms, Average = 46ms ; l. x* {% Q9 r" J: l
g2 |; d, C/ T3 \
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 Y& A8 t/ }/ h2 o4 i8 ~6 O2 M
& d# E; z! Q8 D) U. b9 t0 E R5 y
-l size Send buffer size. 7 \ r; o/ ?5 F" C7 ]3 ~2 f
% ^3 l h( A8 h. r2 T( I
定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54