8 ]& m( }8 S: M5 m3 G -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 0 @7 ?% a |( [' h0 N3 s + U0 @# C/ s! s5 K! K
不停的ping地方主机,直到你按下Control-C。 5 r! w( R& ]# x
' v2 T" ]; y! S" [1 P: `! _ 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 Z% d' d( I u
" q$ d4 ^5 W& s2 v3 {+ B
-a Resolve addresses to hostnames. 2 c" Y" i( O2 f; Y% D! o4 ^9 b
% x) z% ?2 }( T) ] 解析计算机NetBios名。 9 f. T) W) u! b" U9 O E4 V
, q/ r/ m/ [' \( @0 v
示例:C:\>ping -a 192.168.1.21 " J `) N+ Y0 P7 }" L( N3 ? * I' {# `6 O' o5 a! Y3 L p Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: * G3 l! y9 t; ]) _8 k" i 8 F0 a6 m* k8 V3 s" R
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : h9 L' R! G5 u/ U0 Z0 c" R
, R$ L4 C- [2 \* x E: l
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , L e0 h* I" {. C
0 V: v" U/ k% C8 k# H0 n' C/ B Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , u: v6 r6 @) |7 o5 \! {) m. T: P
* N2 F4 Z' k- n/ x- S) i- k. t
0 Y' M& ]' d6 i! e5 Z2 F( u Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - a. ~0 N" a0 O6 V. v, C) n/ }
k; H3 } t A* w) ]# K2 Z. X Ping statistics for 192.168.1.21: 4 r% `: C! o+ p. T- S ; I" \( o7 z0 K" u" ~ i. j
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 0 ?, @" g( _8 Q1 Q" S1 _. g/ r ! c7 p0 `2 c6 `+ ~7 ^) } Minimum = 0ms, Maximum = 0ms, Average = 0ms 9 b: }2 o6 q% H l: n # q7 V4 b1 P6 d; j6 T. C5 Z& X7 U8 X 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 " ^. i2 }6 `# v, F( g8 W2 e' b ; ]+ H7 b9 A' M
-n count Number of echo requests to send. ; l" ]5 T6 Z2 m& F9 o5 p
+ N/ I$ u7 \; D% @: h. `; c 发送count指定的Echo数据包数。 * j( G( o p/ G* G# d
7 s" f& T) b; D- V 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: - ]- L, a# |6 M& \/ v
4 s/ ~% `7 X" V C:\>ping -n 50 202.103.96.68 3 ?( v/ b4 V# e
/ h# `" U; L% Q
Pinging 202.103.96.68 with 32 bytes of data: 9 i7 M# S- q- \, \9 B * H/ h' M1 W% I( A7 n
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - R% r# |' B9 n) J/ g % v# D! F8 ~) \* U/ B& b. |0 S
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 \" S! H2 Z$ g( {
' p; w* v3 z8 n! `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / z' @5 t1 {, Z# y% t 9 n$ e D/ l6 m+ R( i, s$ X' R Request timed out. ' g" b$ i- s3 f F& p 3 f2 K) ^0 W# d ……………… % N0 O& f8 Z# m7 u 3 Q1 U6 o b* C8 }/ _. F
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; H9 D; }5 `1 T) Y y
; @) L% u" U0 m" o9 K3 j: c
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 f, D% F5 a0 p, }" a+ u7 P7 w' O! q0 _ 3 Y$ n4 O) o; @2 F; r% n
Ping statistics for 202.103.96.68: . m& ~7 f6 [ ^( X, J# n' I. S
/ P8 g% q% ~4 q1 W) K7 r
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ! R; L7 A, J- U5 F) c" a ' {$ Q; F, {7 H+ ]1 t* V Minimum = 40ms, Maximum = 51ms, Average = 46ms , v. j* v1 g+ i8 T5 c- S) \ 0 d8 n/ N+ e4 [; O' V# e7 C
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 : U/ x; U* N+ Q+ u* @0 J ^4 T ! u" B3 D7 u: p7 R4 o -l size Send buffer size. . Y8 ^2 G$ A& a8 x) m9 | * s+ \& D! l& w4 s 定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54