Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 / K( I+ b5 T9 @# |3 k. c2 J# g# Q
   5 t# M! C! b. M1 l) R
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 5 ?1 E  O3 X/ G1 B! N
  
0 C; @! s8 J# [' Z  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 . a1 r# q2 G5 O/ z3 b2 m6 u
   $ }  F* u* ^+ |  v
  Options:
5 `' i1 n" ]- ~, Y3 T6 x" ?   $ }8 s/ z3 \% G0 t0 o4 t2 [  u
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! N/ u. @4 r6 A  `# ?% M
  
: f: M  u( |% a9 n6 z  不停的ping地方主机,直到你按下Control-C。 ( g( Q9 H0 e4 D- p7 U
   % N# E2 ?( \0 {9 H7 j7 D* v; B* e+ I
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 1 ]/ F1 i% g! l; n4 O! z
  
  V4 y$ a8 `) I6 X* x6 c7 B# }# i  -a Resolve addresses to hostnames. # S$ c0 d$ s- r. L' W% F# i2 E# g
   3 V8 A% s$ n( d8 C0 F( K! E
  解析计算机NetBios名。
$ h# c8 l8 H, q& X2 z  
/ Y3 h$ J/ W2 x8 l* S3 Z. x% e  示例:C:\>ping -a 192.168.1.21
/ M/ k2 `5 m+ I: a$ E   / r6 N7 M7 n% m
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: * x8 n; t2 i/ s& B
   8 b' q# j, H; I) V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , p! n/ `' ^5 N! |
   6 s# L% X5 H8 ]. N3 ]1 \( }5 M% g
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! ^' [5 I. J# F/ m$ O8 u5 U9 Z) G
  
1 Q9 z: m' Y" _7 E  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / K" Q+ D5 W( c; @& W
4 O" v+ B) l, {& x/ h# B
   # j' p- A, M/ K9 f: S
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 X! \% b  v/ H) {# P. r
  
! v# Z' S7 o  {7 x  p/ W( E; J  Ping statistics for 192.168.1.21: 4 {$ P5 Z! B  P% b
  
: _  `1 i0 [' P' C; U: i5 U  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: & l- k# g  }# q  u& x
  
) @2 g& Y# l+ p# V  Minimum = 0ms, Maximum = 0ms, Average = 0ms 6 c+ i8 J  m% {" V0 M- Q
   ) {; @* y, y0 b' [. A% S( d
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ! G4 V! f  A, Y; X: C; g) W' z
   2 T1 w. U) h9 h, t% f  O
  -n count Number of echo requests to send. : J, k; e) n8 c* J; `
  
1 z! m+ y& U) @2 ~  发送count指定的Echo数据包数。 + t# a1 f2 Y3 r4 N+ c
  
3 [) W! l& K+ M) K7 A) U  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
( h: H" a' D9 M9 O! _2 \: L: w: N  
8 y8 L. n9 O0 {7 n8 a4 |  C:\>ping -n 50 202.103.96.68
2 T% |3 }  G4 U8 U   & f/ J  f3 ^( L) u
  Pinging 202.103.96.68 with 32 bytes of data:
/ j; i; b: V9 h$ c   0 @+ Q  y( C! G& K+ ?- A7 ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( R: @2 a  t5 f7 x. J' v3 R3 v
  
1 W% G2 U  H: Y+ j3 H2 K/ W  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 I+ e/ c3 ^8 y( S( E* I# M/ W) Q
   , s6 _( f: |' V2 V# G7 l, j# ?
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* M& K; E: Z/ j8 F$ C  
$ z- R  D3 h# e" I  Request timed out. # i7 a1 N3 D! e0 m
   6 s  W- e3 a/ K- u; L: g, x
  ……………… ( A0 J4 [# X( e& @6 A
  
- B! U' d& n4 }" C5 _& e  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # t- w" x- v  M3 s8 Z
  
" R) Z0 V! [- K# ~) K  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 s) `" b. ^( d% w1 x* J& @3 `   2 n* p- q  L) P! C6 P5 t  Q
  Ping statistics for 202.103.96.68: ; l: \, D% w. @" n# e9 g* E* U/ D
  
' f2 z; r) k& \$ g$ J  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
+ U, [1 N+ m+ G* o+ m3 W  d   * _! c7 b* F# a' D/ @$ d8 k
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
$ l# f( a: I; a  
6 Z. N8 E4 x2 e/ D0 Y% p: Q) }  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 + A  S9 `0 m8 V7 D* _+ k: `' ~
   % V' B5 R' ]. S+ {# h# D3 J7 |
  -l size Send buffer size.
0 y/ e) w) i  M$ m  
/ U+ J/ x5 J& @6 H+ K" B8 m; y  G9 v  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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