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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 ~6 ]6 Q" ?$ w, [" J" h+ R4 X
  
$ B% n/ T! v: o2 _4 U6 A  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: + j, e, ^: Q9 [' o  i6 J3 m
  
+ F; Y( Y& a; _( r& i. W4 i6 Q  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 $ w' M8 }1 O7 U4 {
  
  e+ u! O' [+ e0 Z5 q  Options:
& k/ n! o$ O$ L& W1 \  
0 k) G' w0 B5 M+ O% e3 s! |  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ( F: \2 j7 r) C; @2 ~" ]
  
- T1 T" o6 }7 V* k9 K7 }2 J  不停的ping地方主机,直到你按下Control-C。 4 s# m  S! N& ]# }; k* L
   $ J( q! H1 n" m
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " J: n, b, C1 O
  
! ~) G$ F/ r( Z& ]/ c& Z+ B  -a Resolve addresses to hostnames. " ^) @5 L* [  F$ S3 o6 n5 ~1 t3 w* ?& a
  
0 b5 _2 f- i7 P1 I+ G: k; [  解析计算机NetBios名。
3 H0 a, K$ s# R8 Y; X+ p& K   $ u8 I' y6 e5 s
  示例:C:\>ping -a 192.168.1.21 * l" S8 `5 Y5 L! `% Q' _0 I2 ^
  
  F1 t! f/ k, |' a1 R4 K$ i- V8 \  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 9 |1 H* C; N; p$ _$ y" q  l( ~
  
% @) y- L0 V- k) |$ Q; b  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' V4 Y' m$ t" q. c
   5 b- G, @" t. Q) i5 U+ y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 {( y; P# }& T; ]8 ?( s  
- F# u2 h+ V2 J& F+ l" d+ M+ C  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' q5 w6 M- [& L5 a- f
, t4 Q; ~- D' ^  N
   ( l& d" Y- W* V$ |/ F# w* o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 o( i7 M& j# l- T% F  
# l5 [7 \. t7 x- U  Ping statistics for 192.168.1.21: 3 Y4 c2 X# v0 }/ }$ T
   : {7 k/ k+ o" p
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 @# H) a# j/ {2 y" g8 ?. d  
9 H0 M, l  {$ x: n+ @7 F. w( k) L  Minimum = 0ms, Maximum = 0ms, Average = 0ms
; ^" \* H- A0 \5 q! s4 b- L   & H+ M0 w) o3 W- L
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 . q4 u: y# R( U8 F' Z) L, u1 b3 m
  
( `3 _: ]& E' `  -n count Number of echo requests to send.
) j( {8 ^% B$ h8 Z# c' |2 u& B  
$ E' ?: C( @% N3 S! W8 S& y  发送count指定的Echo数据包数。
) q; _! r! s9 J2 ^( h2 ]9 d# D+ h   6 [: J3 B; v- W2 w, H
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: " Q1 w" p& r- x; u/ t* x+ J  y  X
  
% L# X6 Y& N+ M  s0 Z8 E  C:\>ping -n 50 202.103.96.68
9 P8 Q: Z6 W& X1 y( ~/ M3 \   3 w) H6 f. K; ~2 m
  Pinging 202.103.96.68 with 32 bytes of data:
- ^& _+ @  }( W  
1 j7 h" K" V9 `6 X% |; g# J# V  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
7 \+ c4 Q- O: Z& g  
7 Y! u% \% o3 N/ n  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - W: S& Z+ J1 L
  
) }; {8 b& v) E  ?2 _9 I# o  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) }& T1 t/ W* J3 @3 c3 }4 x
   $ Q4 G0 X$ w/ M
  Request timed out.
" ]7 a1 n" B& |- M  
$ h4 }. e, ]: j+ f: Z  ……………… ; i: z, W+ A+ {7 O" o8 M) r5 ~
   & W" L7 ?/ w+ M
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, A' j' M1 a/ ~/ Q   / ]& [/ x& H) D, f* I* {4 B& N
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 s! w* W/ b2 E+ ]6 ~+ t! V
   / _: y# A6 ?- r6 R
  Ping statistics for 202.103.96.68: + g) v/ ?4 l5 ]# q
  
: U7 l7 u. q" g* x4 B4 L  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: # |0 b. u& |: `0 U& L3 e8 K8 x
   6 H9 C, G7 k9 f% D
  Minimum = 40ms, Maximum = 51ms, Average = 46ms , H; F+ K0 N6 ^5 a" B* R5 z9 q. F1 o' @
     k7 T" g& H: O- s% g
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
# I2 f7 d' _/ X5 G1 a0 F# c& H! q   - K, |4 v6 z# ]' Y
  -l size Send buffer size. / A& R) \+ u9 o6 W2 _# K
  
8 E( f4 r3 @9 Z5 n4 j  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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