5 m v- N9 ], E% [0 s6 | Options: $ v( b$ ]* S: P* g3 k1 B 0 w6 h7 L3 c. e/ g* ~' R4 I' x
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 0 }$ _+ K0 p6 G0 i
/ c$ p5 T" p5 B1 P- ?- L' D
不停的ping地方主机,直到你按下Control-C。 # o0 e: L, u/ V
: e, z6 E" W5 F- u! Y
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 . q8 E! S& o& r% a: Z: t
3 p' X' |. A/ @ -a Resolve addresses to hostnames. ( O+ `( w- S$ F* I
7 M1 Y$ v9 w' B/ D+ q, G' [( P
解析计算机NetBios名。 * J* E" U6 \$ X/ T4 {# _& C f4 n1 J Q- d0 |) \) S; h& ~ 示例:C:\>ping -a 192.168.1.21 9 |9 h. Y2 X: d2 T) A 8 A3 x5 k: j5 O0 V Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: $ E6 [+ b% n% q4 ` . s: G1 Y% u' z( f# r/ X* \7 S Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 z% m0 z# h7 d8 |) T9 { ) f0 O5 I, D/ v Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . U4 H1 X; s9 }4 `1 `; b
7 d* T# G/ C( L: L* r D; S Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; p0 @; u7 k* m7 `! Z) \- s2 A2 ~# R. L5 i8 C6 @
, M+ i' @* Y1 {: k% C6 D- @ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + T- W/ K! f7 B# H; D! E
2 l+ W7 k Q) h3 B+ Z
Ping statistics for 192.168.1.21: 1 o2 ~! ^* u4 z& j8 n, W- L9 J . Q S# y! }3 |6 G& w; J: [# P Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: : R- |6 s" G8 C/ u1 G* U
8 Z8 s! b# r" f8 s A5 F
Minimum = 0ms, Maximum = 0ms, Average = 0ms . V1 u6 S3 o1 {9 { 4 N" F. O4 n- z5 r" } 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 5 c# w: m; Y9 ^( W6 P
, M1 _3 i9 E& n a
-n count Number of echo requests to send. ( n2 ?% J. t9 F0 G " @, g4 g7 {9 P: Z! ?% O$ w! P 发送count指定的Echo数据包数。 3 F* i# [3 V4 i, L: l8 ?
: @0 w3 }' M; m8 K0 Q- i0 F 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: + S, ]+ e3 a! U; v
& {0 o4 ~" s& O* x C:\>ping -n 50 202.103.96.68 9 F" i+ \& U! ]1 \ - p* D; w8 X. S" M4 m0 i
Pinging 202.103.96.68 with 32 bytes of data: ( e" r" s6 ^, K! g! S2 r / m7 c# X9 [2 X* a" G Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . d+ X T, U) X2 _
. @5 ~1 }6 R" Z f
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # |- H9 V! F: r E& T4 m
% b: f+ ]. Q4 i. y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; b1 i# p* e9 k # T$ S7 O! s: B+ h Request timed out. " e$ h: _9 m9 W% X1 T
& r: W6 n0 x" y7 }
……………… + H. E5 w' J4 c! U % h+ p; ~/ T) P7 Z' U& r# }8 |! W Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 n6 j' {! S% c0 i+ s: a! U , O! _0 A Y7 G% o/ R/ G
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 _( v% r/ Y+ W2 U
* e' s* v) H+ Q, {6 F3 b, v3 A Ping statistics for 202.103.96.68: * D a. g1 \5 R) |6 [# D, r
, G2 i& Q) | I
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 4 {( z* a% h4 y2 h8 k$ m 2 k$ z% Z" p# M" P Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 s: `9 e: x2 t1 C9 ]9 {
0 H. v! B4 z# D" O6 K 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 4 z1 U A! k( k) l, i
: D! i3 t+ W1 n- t7 n -l size Send buffer size. 4 E1 y4 |; \; c " z3 b9 V k Q8 Q. k 定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54