获得本站免费赞助空间请点这里
返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
3 o, i' M, w' l( I  
, ~! ?& A# t: {7 n3 u8 {  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 8 o% p6 ^9 A- Q, V; q
  
0 G1 A& B( u) S; n) U  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
' D; j' I+ Y" Y4 e+ u2 m4 E$ {  
' |& B# @9 c. h0 S* ]3 R9 b/ M! W) V  Options: * Y6 F6 i# d$ h8 N7 G
   # m2 W0 P( W. l- h0 Z
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
! n5 c' T. H# J   2 c) Q1 v. H' s) F: A7 w
  不停的ping地方主机,直到你按下Control-C。 $ o. k- t& L" s% w! [* V3 S" q
  
' h# Z2 G6 X5 V( s  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
7 e& h$ W; @5 E7 h8 j! m' W  
, @+ i: u. s! h+ a' g- ?' U) X& O  -a Resolve addresses to hostnames.
5 G3 ?3 @8 y! L" y1 a4 ~  
+ B8 i" U. @1 u) ]  解析计算机NetBios名。 ) I# {2 L5 J  e
   / P9 P: W# ~- E" v
  示例:C:\>ping -a 192.168.1.21
! p/ C3 ^1 f5 O9 a& l4 o  
6 x' b1 |5 g1 l. ^# I  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 p3 A4 T; p+ \+ O2 @; z& \1 |5 A  
& q5 B) R  T1 n( c+ G: W+ R  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   X( D" l7 s  @3 f& L7 v
  
% ~# f' g+ X/ J: ^7 ^  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% S% c8 i( c% l8 L  R% W  
: o. j/ n  t( k6 D6 p  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, z  D" h, s. m1 v) V' k4 E7 A3 q' y5 L3 a7 K! D
  
/ O* V% L7 z+ g* l  |! u  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 j" t  @6 b/ A7 v
   8 f+ J; s+ C* G0 B& g9 q
  Ping statistics for 192.168.1.21:
4 V* ^( S9 P0 N) ^4 K   + n% @: f+ @/ n% b+ I
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
. Q) G( ]6 g9 \     q% u, [9 w. `% a
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ; t, X. w& K  d
  
6 g4 z" L  w% C6 @6 r9 M$ D  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 , ~8 s3 Q2 J. k& k. [: p9 q
  
% \8 Y/ |" j1 d! }7 w1 O8 |/ D  -n count Number of echo requests to send. % U' p* z- n, d) G! S; U
   % p$ F+ T& \& [6 y0 f$ [. O
  发送count指定的Echo数据包数。
+ C! H* _% ]& `# |4 }9 x& j  
0 b* b( F) i6 q+ A) Z2 H0 ^# ?  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 z9 `2 {6 Y. Y+ o1 h& b6 L3 a
   ( j( t7 }  R2 n& [
  C:\>ping -n 50 202.103.96.68
# q6 o" Q- w, Z4 n: c6 {   - v& r" a: m. g! i; {" F- I% N
  Pinging 202.103.96.68 with 32 bytes of data: + X1 ?- R" @' D2 s
  
0 j" L& J" f1 ?  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' m' k0 ?, Y7 D, L
  
4 w$ U$ [! i7 y: w  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, e$ S* `" {; s2 L4 o1 [   ! m' e: C& j% j9 k& `( Y  `7 y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; C3 h, J! t8 J
     I$ P+ n) F. \& }
  Request timed out. ) R! _+ v+ O9 `4 Q# d8 P3 Q! P
   5 {, I) x2 Y/ }! y* W( M, ?
  ……………… 1 P! i2 y% b2 c& G! h: J
  
1 f1 ~" s! |7 U% i  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 Y% g- Z0 F5 G1 v% P% ]  
# Z+ G; Y' f! G9 d  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 j+ t0 I0 @$ Y3 A7 W6 f   " Y* a# A5 i- ~- D
  Ping statistics for 202.103.96.68:
' `& @4 P% z2 U# Z  L4 d   " Q7 r; }' ~- y
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
) T3 @: U3 i  x4 o  
# E1 e! G% u$ C& S% A  Minimum = 40ms, Maximum = 51ms, Average = 46ms
8 F; G, F- i2 W+ n) j  
, O( s% O9 O# n3 M# U1 e& R  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
7 r; Y# F& j/ P: g+ H1 E   $ t7 t7 h; {) E9 V, L
  -l size Send buffer size.
; N' S! j7 A( M  J6 O( ]   5 b6 B- M% b, n/ B0 S" p
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

返回列表
【捌玖网络】已经运行: