Board logo

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

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

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 , z2 R" `/ t* A' A% x
  
* u4 U1 S0 t9 E8 s, N6 x  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 7 b1 J) k* j6 g  g0 e, o
   + V9 ?. W$ S6 |$ e$ W0 r  c
  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 ( i1 ]. x% ^4 h& Z5 ]  W, d$ `& g
  
% y7 ?# b  M5 F+ y$ c* m2 B+ i* ~' F: c  Options: & ]. n: H4 Q7 \! i- _
   / |8 P( t" g* v7 ^% `$ D5 g
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
, o: L, Z( i' d, ]& N  
/ L5 C- G4 r- z% b( C: Y  不停的ping地方主机,直到你按下Control-C。 1 X/ f3 ~3 O/ j" E: U% R
  
* o: T. k" K: b* |7 y! x8 f4 u! _  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 - W1 ^  d0 B0 u; g
  
, g* K4 ^6 U7 \7 i. i8 t  -a Resolve addresses to hostnames. * R; N% m) t; q& L' l
   , F$ E) _* ]  u1 Q, Y& P
  解析计算机NetBios名。
2 q& J! }- ]! Z! g( m  
% b5 S3 U1 Z' w3 v9 `  示例:C:\>ping -a 192.168.1.21 3 T! X* K3 Q0 w1 O% \7 ?% N2 X
   ! v' H2 {" @/ [8 @  H) d0 ^
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , ^0 d# p. H; \3 a* b6 V& W
  
! ]3 {; |2 B% q: W5 G$ |. X  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : F' X3 D; s" V. K5 s4 i) w
   ! h4 S/ d7 Y5 P
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- B$ l5 V& q$ j- M* O' }6 [   & F! Z4 o4 B% i! H% |
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + y3 a" o; v- z+ s) \( ^. @4 T

( S% j+ f  j! M: E  f4 i" c7 v- ?3 Q7 n   % ]& `7 t3 F4 V& |' ?5 z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 |& k+ p: ], _1 s
   1 A% t) q; \/ I* o8 t
  Ping statistics for 192.168.1.21: & N2 y( G! T( `& x
  
8 M& g! h3 X4 P% b  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: " C( k7 t& s3 A4 g. l9 N' z7 F6 k
  
: k9 G7 I4 x1 b0 t1 I% [  Minimum = 0ms, Maximum = 0ms, Average = 0ms - d4 q0 {: N' O7 V. N% s- r
  
6 Z6 K* T: _" D6 c# M/ |  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 " t  N  x. r- D& ^8 E9 _  z3 f
   : H/ X  q# i( L1 b# ^4 o' g
  -n count Number of echo requests to send.
# z" H' A; x3 u  H   5 _3 [/ S' |. i, @1 C
  发送count指定的Echo数据包数。
- I; D4 P( U5 T  t. u  d  
8 v, I. a) R( k% A  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: + O& n1 o: X6 m3 ~' m
   4 Y: B3 w  }0 N
  C:\>ping -n 50 202.103.96.68
5 c; G' u9 j" S4 v# g9 L6 w7 j  
! T* M4 z6 G& {$ J* r4 O, Z  Pinging 202.103.96.68 with 32 bytes of data: # N' w9 C4 I: i/ u0 \
  
$ ~0 C- f5 q' c4 B& H  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( p" P3 F' b* P7 d' q; d$ [   ! d6 g& R. t( Y* {1 @( S$ T6 {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   N0 d5 F% Q% Q9 E2 A+ l
   ' }8 @% X# q* C4 j$ d/ L" z
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + t4 d) P: z& H" [- o: o
  
" b) G9 P0 _2 `9 n0 A& K1 H/ w  Request timed out. * G0 v7 X8 h9 q
  
. g' ?( }- H) w0 m3 l  ……………… - b+ P5 I4 w' O8 }5 q
   " v: h9 Z  U0 X+ ^! S9 f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! D1 K' S* I4 h* f  
  j. F# J* u2 f; P  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 Y0 p" E5 }) d; T' n/ b  
1 L2 t( d* ~+ R  J. Y/ c% }9 [  p  Ping statistics for 202.103.96.68:
3 ?- N( I, B) g/ [  
+ R3 r5 f4 ?1 I; h7 L& q* i  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
( w! g/ F0 d- u/ ?   ( M: E6 B$ o) D6 x% n
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 0 E* S2 r' X5 N: w
  
8 I4 K  |( ?! d& C% e  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
! O3 @. K# O6 G9 d  T     X$ p# D1 O3 G* X* W! G
  -l size Send buffer size. . o6 z/ {" m$ y$ b3 L, V
   ( Z+ Q: T/ ^( Q6 _& y. s
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




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