+ w/ T1 V9 q, U& m N -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 1 }5 e0 {) S0 H: L5 h& p
' C3 @" ]$ i# m. v2 ?' s/ {8 }1 n
不停的ping地方主机,直到你按下Control-C。 s" d" M' } `+ }! [
0 z2 k @; I" m. p9 V3 o 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 # K) w. p" Q5 r: F. T" R
; u/ M" y0 s. f
-a Resolve addresses to hostnames. 9 ~2 b' ]; m$ K+ j# B, S" }' s% \
% m9 v$ J/ M9 B3 y/ u 解析计算机NetBios名。 ' I `& ~7 e/ R* O3 H ; P4 m# J- L1 B" k. V# p) t* J
示例:C:\>ping -a 192.168.1.21 ( f9 J' f- r4 h g . O- g0 I P% f6 g Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , j* u! ^4 X _) W; ]2 X
/ S2 W* u: T# R( T3 R( t
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( g. C# n1 b; a : W, a% D! E" `( d2 j2 [$ ?" U Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ ]! \3 }) ~* @& x9 | i0 i x- L0 |: e
" w6 K0 p$ i: d ~- h% Y, P
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 @' Q$ C3 l" b B& i g
2 m6 l, m' _% ?9 y% r! m 5 [3 u% B3 A0 d Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 ^% Q% z8 _( E) R$ |; V3 n. I 3 z; L9 j! |* |4 E Q2 ^
Ping statistics for 192.168.1.21: / Y7 z8 u" \. d$ U# u0 d6 @4 U
7 m( l: X% n5 q! E$ n! }( Z; M! I4 J Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: G4 C7 n! h: B6 f( J4 R
) Y0 H+ o- L% `% B! @ Minimum = 0ms, Maximum = 0ms, Average = 0ms : O- t1 l# w/ N* G. a
; n$ f# S+ a5 o! c3 S: w' i1 O8 y9 a
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 , ]4 D. e& t$ a : ]" x9 q2 \* e' |9 z3 x% u: i -n count Number of echo requests to send. , `5 S, F3 ]+ @7 z4 Y+ R2 P* A : a6 x& }8 l% K3 E7 x: t
发送count指定的Echo数据包数。 0 f0 ?4 d3 F- X
$ _2 j; F$ |9 d8 e4 Q
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; z, a- |# A4 I0 K
, f/ H2 k) s7 l' {
C:\>ping -n 50 202.103.96.68 6 P8 a5 e' ? ^6 b( h $ l2 W5 Q; P- ?5 Q' W; X8 E$ q Pinging 202.103.96.68 with 32 bytes of data: 1 X; x; l- a0 o/ n
+ m5 f8 J X/ U+ a) e. f. Z Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - f2 k4 [, w* m0 p- F, ?" E- | $ h: A* f: e4 l- [
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 _; G% r. a& o6 ~) ?
/ h) D9 ^( b, k% T" w! z) `+ _ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 g8 x& @8 ]" G
0 b7 Z4 o! s4 G% c5 N: A9 r" X
Request timed out. 8 t0 Y6 q& e0 ]# I3 }
/ _# n7 }8 N9 b+ O4 m. a
……………… 0 \$ g4 T8 l9 H5 t+ X% k7 L$ g 6 q) W c6 o4 t+ L Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & T8 e: y1 M2 U! y3 d * N# ~, z9 V( K4 y" l# F
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; F2 `4 R# o& v- p5 {! K 5 | {! u' z9 z5 m# ~' D6 F Ping statistics for 202.103.96.68: 2 J) n/ Q5 @% V7 b5 E( @ ' n# M- ~9 B7 G Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 4 ^6 j& w1 a* {8 c( q( m
" ~. m% D; E7 U/ g4 |/ l- M
Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 q @5 z$ M; E, w5 d) j
^/ h' O# v0 g( {
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 , F/ H& w9 x1 r! _/ c2 n# u 1 g3 ?0 e# O; n% E: f9 C$ N1 n! a
-l size Send buffer size. * p) o) \3 f8 R' o8 t* D- A9 _
2 c) O) q) z J5 r; I# y4 H/ x
定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54