1 d% A$ m2 T X0 ], a0 b -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. " Z/ c* D; l, y3 R3 k % }9 h: J- e3 e5 h0 D) r1 x1 I
不停的ping地方主机,直到你按下Control-C。 ; K* l0 r, b# W9 }7 Q
, t _) y* ^- w+ Y2 T- W$ k' Q
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 . C+ Q/ S* O5 G* @, j. ^
5 R/ b/ Y! T8 n9 s
-a Resolve addresses to hostnames. 2 I3 F7 ~& z: F" |6 y0 [
' u* j: r2 X8 }; O' ?. a) T' ~. ` 解析计算机NetBios名。 # Z) N V/ A/ v( X# b7 K: [
1 N3 U0 J# _ P* {" R; M" @. ?
示例:C:\>ping -a 192.168.1.21 ) x' |9 B$ e* P
( c% {' O% G Q5 U7 u9 o* O0 Z Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: Z* V' T3 H C; F2 q& ]( ~
% \* F( J/ i; P- J
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # A: X1 f( E7 B8 s3 F
7 g# Z8 ?! V" Y/ q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' V. @" h% M9 M% J8 S! z 0 L! v7 `0 L7 ~5 L2 O2 M4 V
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 S/ {- J. a0 t8 ]7 o' ?7 Y * P* s) m- t0 x2 C' _' i9 I y 6 F/ l. ?' y" E% |1 \, W1 w; A! f Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * q6 ~$ Z0 D3 F1 o9 g . n/ H v- K1 ]# B& y: ] Ping statistics for 192.168.1.21: 0 A2 [/ Z! o Y' D; L r! m9 T. I 9 w E' v' g4 `9 e Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ' ?( S( s! a$ I g# K' [. r
7 F! e8 Z4 ]' H( E$ `; e4 [, ^) }. l
Minimum = 0ms, Maximum = 0ms, Average = 0ms 5 M0 q: Q( X% D1 |9 X! m. A 7 T6 X' W) S8 g" T' `5 p1 [
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 1 K# m% {$ E# g
+ r4 d Z: t1 H
-n count Number of echo requests to send. 8 s, ]5 R; s( |' ^, _0 `5 h& F ! a( P. j2 J. d* ?8 n" A1 r
发送count指定的Echo数据包数。 % ^$ R" S9 t4 e
$ z0 p j; q# @3 f
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ]+ \6 W$ Z6 _( Y' a6 ~/ |
& f3 `" G; U% U. I- w
C:\>ping -n 50 202.103.96.68 4 u3 }7 D- u2 a, @: {. n8 X9 p
% e) V0 \ _4 G+ }8 }$ l) p Pinging 202.103.96.68 with 32 bytes of data: 8 J/ {- [0 H$ l' o$ Q
9 n! ]% t8 ^* k/ G2 i1 R7 h Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 o* P3 [- v7 s. S
& u- l" L& h# ^: u- a
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 Q0 ~. c! P. y
7 Y$ D: \/ X1 {7 ? Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' H' R2 p1 q, V1 [% a0 }0 f ! o" Q: c: q( B! I
Request timed out. , C H( W$ Y0 l0 Z/ o
( w9 e/ }5 S9 @/ {( E1 R( D- A# X$ y
……………… % U5 p7 W8 A# _" e # `/ V8 i) Y. Y3 Q
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # a3 w& Y8 @% x/ ]/ E: d ( J; ]( U' V- V+ b1 ~- {1 L/ K% | Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 M, _* b; k# l ! M% T% G- O# Y. Q1 Q4 r
Ping statistics for 202.103.96.68: 9 n2 E0 d2 Y1 Q+ n( A. r0 t , F3 y* }( a9 |# R/ q+ v
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 6 A m! c( S# g6 ?" M 7 _5 R# T$ K+ H2 k4 d8 X
Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 }1 p% z* N7 w3 j2 d