3 Y S6 v3 d6 D& z/ b I -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. , R! R& e1 b" }4 E$ [
0 S% z% _- |" h5 U5 |* H$ t& I) E" H 不停的ping地方主机,直到你按下Control-C。 ! Q7 Q; E! O% A + j+ k% X; m. X# V# a 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 1 @) @4 x2 r1 s$ Q+ @# |
& y6 k: @! _" S6 U
-a Resolve addresses to hostnames. $ h$ x0 m2 `* L* r# A 4 q" u5 n( h" t+ z- A, @- F: p! D I! B 解析计算机NetBios名。 5 D+ D% d4 H- ]5 s8 T( `7 ? $ p$ ]( N3 x- E 示例:C:\>ping -a 192.168.1.21 3 M* c5 \9 w- O, J$ d
* z6 x( J6 U `$ b( g Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: + Z- j5 B3 w5 R$ r
, N! ~3 T$ H( O& L
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ X- u4 m- U6 \* `# p" p, c! x " F/ V* t! Y0 J8 {4 V
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - ?) u# D( n g/ x" S+ |
9 u7 w% Y: U4 n# M' X8 r1 @) W Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 }) @& g( [7 o$ P1 Q # g; L, F2 G% g d $ t+ ~. K8 G; ~' }. Q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' A2 E) r! w# _( M4 [ ' B/ G& |( w. Y, I! X3 C% F5 j Ping statistics for 192.168.1.21: 9 b6 l$ T( c* \8 |. B ' P! K3 E* P Q0 n' c4 `/ r
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 6 U; y! `1 x* l! t ' g, j6 O% Y5 L- `8 } Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 c/ R8 \' ^% v9 S- `7 Q , w) V* y R) Y3 C9 w, t; S5 ~ 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 / q" v* k! u' X% ]) G . r( |; N/ y, a' J3 J7 q* o -n count Number of echo requests to send. . `: I4 V) X7 ]& M2 D
, y3 p& n, P. |5 R 发送count指定的Echo数据包数。 & X- I* m+ ]" Z! h
2 U- }# n9 n/ x 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1 j: O; I- K+ \/ E3 f' ?
! c" o/ [6 N) [0 h: K7 u' P C:\>ping -n 50 202.103.96.68 4 i$ \* J- z1 |) C% w1 r2 c8 A, u ' \( E" {. j' l. G+ W
Pinging 202.103.96.68 with 32 bytes of data: % C0 H/ B/ G' [ t( Q) |- F; @
+ Y7 y/ ~0 ~/ N) A/ J Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 c1 _9 x) y9 [
# @, k R5 o) `9 ~2 F- o3 A5 w
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , w( K9 M8 H8 ^9 o- D6 c3 q
! ^* F/ p( P: W
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " V, N/ d# Q0 E% A- x, q 9 l1 Z5 C5 V8 g* L Request timed out. ( g( v _# L# F: _: Y/ w : n3 F3 ]$ K9 T' F ……………… ' w6 y! d" s, l$ j/ u3 E; o, v, U / d( D; \+ i# \+ s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! t/ p; g% b5 t9 L
/ b y3 ]0 a+ w Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 q5 s& l: K1 m8 u5 L 3 s& o8 i8 G) P+ Z Ping statistics for 202.103.96.68: + p. w5 n8 X: [, U7 v$ ]2 S ; p% z& t% \0 t/ O
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: - S8 W4 y$ ~- T
7 m9 I, H6 F* |3 {7 G Minimum = 40ms, Maximum = 51ms, Average = 46ms # d# M h) Q, o9 v9 ^
6 R' f( V" x! ~
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 * }* @0 k7 g. b! `) Y( c : b7 }! ] B: C2 K5 u+ ~$ t
-l size Send buffer size. ( o& K8 N: {0 z7 u3 k 1 K- N# ^" ]6 S% S9 E+ ~ 定义echo数据包大小。作者: 冷雨清心 时间: 2008-9-25 15:54