Board logo

标题: 教你正确使用Windows的Ping命令 [打印本页]

作者: 野人e族    时间: 2008-1-27 22:16     标题: 教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
* w, v/ I  B/ o+ @! j  
3 M2 H7 T1 u) y" n  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
% `# s& J/ ~% \7 p- H   0 ?7 F, M' r# K* Q2 H) y4 {% I6 r
  ping [-t] [-a] [-n count] [-l length] [-f] [-i ttl] [-v tos] [-r count] [-s count] [[-j computer-list]   [-k computer-list]] [-w timeout] destination-list
. {3 e8 K  `, q/ A: P3 {9 o  
  {3 ^3 q# Z7 s6 [/ [; z  Options: + M! S0 E. d: D9 N
   ; a4 C: g  u* l3 U/ z. `# ]
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. $ Z8 Q" B/ w7 I1 F* W/ e9 p
   ; y& W+ |1 x) g( w+ C5 L
  不停的ping地方主机,直到你按下Control-C。
) W2 L7 l6 d. J. k$ a  
5 E3 g. K9 E! }* z  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 % Q$ u! O: v$ r& H! ?' S
  
2 j& P2 |/ N6 d0 y2 U  -a Resolve addresses to hostnames.
; D# o" t! a. @, ^, z  
* ~/ p: e, A* }# X; f  解析计算机NetBios名。 / F1 G- {7 \8 \; w9 f
   0 `8 H, a7 Q: u; z( ~6 C% X
  示例:C:\>ping -a 192.168.1.21 $ X' E* C3 u. l
  
! f: g' O) K$ R& y! f8 @8 O( v  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
  y! m5 k- }1 E2 ]; L& l. f5 o   : C: U6 M4 K. q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , i" U- C7 H8 v1 n6 O  B1 f% h
   : a2 E& j7 p; L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 q/ Y- l: G0 z0 D# V! L6 _! G   8 O( z( x3 `  _) X1 {( A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: ]; P! ?* l$ |3 u8 V
6 s- ?( b6 |2 n$ j/ u+ i+ L( M# a; Y   ! M4 p$ t5 Q5 M. i" X% [9 a; d
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 Q/ f( V2 k8 P' e: g   " _5 J4 M$ Z2 i) u
  Ping statistics for 192.168.1.21:
! p9 M5 q6 q( l6 a   ( x2 t' E0 m- m. s
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: : I! h' Q0 p# B! ?( u! r3 H4 P/ ~
   : R! d  O$ k' v0 {* w3 d
  Minimum = 0ms, Maximum = 0ms, Average = 0ms & ^6 s/ q# j' ]3 {0 g& T8 p
   9 @' T" d0 E- X' G5 I4 M/ t
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 2 X! v& h1 q$ L' H# d+ K  q
  
$ {5 J5 p; G3 G9 [' S. P/ B  -n count Number of echo requests to send.   |: B" X' ]9 \+ d5 C/ o
   + ~4 O1 t( h2 V8 p7 f% k
  发送count指定的Echo数据包数。
1 F0 H: {9 G# {8 D5 @4 A   , G4 ?2 P7 d; a8 `/ l
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) r' `) y) [" k! X: o  
( T5 Y1 h8 F; o7 c! Y% H0 \1 U' ^  C:\>ping -n 50 202.103.96.68
4 g- c4 {9 S8 B! L2 c   7 u0 E0 L( f- {- v( e. U6 ?: L. A
  Pinging 202.103.96.68 with 32 bytes of data: : I, }: o9 M& Q. Q4 w2 R1 S; u. ~
   $ ]+ @8 k! d; B* k. h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * B  b: j5 E/ P: k6 C+ N
   . J+ @' J/ S" X2 o, a: s# l  _6 V
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* I7 y) ~0 G( R+ y8 A) {   4 V0 l$ L; d2 ?7 i$ G9 |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " j1 C* e7 H0 X0 f: ]4 Z
  
" d- o2 i8 s/ }3 |8 |; t  Request timed out. , D& z. Q) j+ E$ Z( p) _
  
( H- ~+ V, g; S! N1 N8 Z  ………………
& m% L% ^. o; E" m, d/ T1 F  
3 X/ _. h% g  {  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ R' l4 }& k# \( w3 O$ F. z" o   , V& K% K* u7 j( G1 i9 B5 E
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 z, H" l! w! B. R( k/ m! \  
" ?6 U4 C. q$ E! ?* L2 [& t  Ping statistics for 202.103.96.68:
8 |; H2 [8 s; j9 I  
6 T4 Z8 t+ h7 U1 {3 U' v3 _) ?  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
# B% V4 J* @) P  
& c) n* F1 ?$ k' n9 S+ o  Minimum = 40ms, Maximum = 51ms, Average = 46ms : K' c6 e0 M3 g, u8 I% {1 n
  
% U# t; H7 X, {  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 1 x3 G9 s/ X& X! V4 P
  
2 i  s+ e9 b/ d5 I  -l size Send buffer size. 6 n) e/ J$ n0 j5 R5 |* h8 @% g
   " B: k/ m' x& o9 _8 w5 O
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

强大,但是我看得不是很懂!




欢迎光临 捌玖网络工作室 (http://89w.org/) Powered by Discuz! 7.2