+ o! N) ?! y6 |1 r Options: - Y8 S, S$ }* h- L( |
. t# X2 d% q& g- G
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. , \6 f- D. G' f- R% W2 F- H
$ n. i i. `% r 不停的ping地方主机,直到你按下Control-C。 ' \2 i1 N. J7 K$ ~! T; | / U+ y" `) F' j
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 . T1 G9 l, J0 { H# {
) ^: H9 T2 M5 Q' a -a Resolve addresses to hostnames. 1 I/ s$ m7 P, L- ?0 U- c2 H , X/ Q& F7 Y) x% e3 b' t
解析计算机NetBios名。 * J9 M1 H' h" T. n# o1 r
' y" y) I- n7 `2 y7 G6 D 示例:C:\>ping -a 192.168.1.21 1 e+ j9 U, _% a/ ?" Q" J
8 z3 d* ~1 _7 X, O* v# ^ Q6 { Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: # J' P& f/ s# T* {3 _! F) o
7 y) B/ }; [5 o" d
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' _0 j; I2 d8 V2 |
. v' I1 [" ~2 ?3 }) Y& e: \1 C6 T
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( C q8 `+ a4 P$ r! A; h7 t1 w3 X+ y$ ` ' Z2 ?5 Q- j" p% K' J: x
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' R# _1 N7 t/ D$ O
7 B* M; q( {% d c0 J
. s% ~$ r4 x6 }# C9 ?
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 [, G0 ]+ I5 j
6 D! X6 D H6 ^% e+ N, j. | Ping statistics for 192.168.1.21: 4 h/ i5 m1 Q$ r; K' v2 q" Z # m3 p* O2 f; I O3 d4 N+ `! K4 ` Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ) @( ], X8 x% ~0 V; B$ |# c
* X6 @9 A' Y4 t! h Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 Z. k1 @/ ]" L$ D$ g |# z
1 M, k) }$ g& r 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 * `( z% X- ]3 j , \+ p! m3 I0 k: C; G4 X -n count Number of echo requests to send. . p% y' q9 t9 m" x9 r. J. L
; W' X% B: Q) h: c; p' r 发送count指定的Echo数据包数。 2 x% w' Z5 R* |4 H
+ ~8 A8 ~- O2 \9 x& W: l
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: / u. N/ j% k) d9 c% L
3 D8 X- ~5 Y, z
C:\>ping -n 50 202.103.96.68 ; X4 _+ W5 F2 t3 `0 }% j
" F( W. W) s8 U% ]$ [) |
Pinging 202.103.96.68 with 32 bytes of data: 0 }3 W. m# I. w% i' z+ V! f6 P8 D: t 2 z7 B# L- Q4 Q Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 o C ]1 B2 {2 g, s+ x+ Z 9 _/ U. _, ^' q$ @ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 ?1 j4 B6 s3 N/ ~3 z- [9 R
) `' \& e" S4 L) y6 a' s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & e7 m) y8 o3 U4 }! M1 P, x7 m
# [) G' y# f( L+ X; P' f- G
Request timed out. + b- W+ E" A8 l p+ Y2 u6 m
! z: F3 g" Z( p2 a
……………… 0 L- f* p! g- V . z2 j' u" z* C; b: A Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : a$ |6 J# I; U% h $ f3 c2 _; B9 G; [: n# `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 M" [1 U8 {+ O4 D3 I% r & G8 F7 {; G# [: \, v3 x Ping statistics for 202.103.96.68: ; K2 Y; K% g: R! `$ u 6 s" T8 }; p7 S; J% M( h Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 7 _3 _: v& R$ f4 Y ) r/ W* J/ c! g) ] w! E
Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 `: _7 {5 i ]2 A! m' w
( B% C' [( q' l7 W* R1 w4 U
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 / H2 j' Z2 B8 c5 W/ a