返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 1 N4 I2 c1 y- _" |
   ( {& C/ T. ^" P* ^; T
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 2 J6 h( j: }% Q5 Z9 h, ?6 K' J0 y
  
6 n" S0 U0 s- K+ l8 o  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
# p5 t& T; {+ p0 J  _  
( y' |: @5 e& }3 l  Options: , R  g7 @0 ?6 O* c7 F. U
  
$ a( U0 a( M- b3 p; T5 D1 u3 Z  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 1 I) G9 e! T' A8 e* R" s, D
   3 l$ {% q, p3 x/ ^0 Q3 _0 F
  不停的ping地方主机,直到你按下Control-C。
, A9 o% `& \; M& f$ m* |8 g  
) s' _1 Y+ h3 |  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ' z5 L8 Z/ R* c5 f9 W, S8 `) D0 U
  
, U2 ~, e1 k# j7 g  -a Resolve addresses to hostnames. + m. h/ B# H, J$ J* L; U5 l
   7 x  C# x2 D+ I6 g9 a
  解析计算机NetBios名。 ; V! o+ k; r' o( @- C3 T6 ?* k
   4 I( C+ H! u  g- u  I
  示例:C:\>ping -a 192.168.1.21
) v+ ^3 L. g& ^1 w   $ i. Q0 z5 m2 ?; O% s
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
6 G6 I5 r- Z5 [* [( Z& n  
+ Q6 ?" e/ ]6 C+ {; d: z  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 L, {, m2 ]! G5 |  
' c" [2 _. Z- ~6 a( b: P  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 W# W) a6 @( T2 k+ j   : ~3 X. }, |9 G1 ]0 M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 @, h$ E, t1 E7 }3 @3 u+ ?  {& T. H9 _6 w+ U) j* |. ~" K
  
! n/ d. B0 x# E; T" u+ H: R  ]9 x  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, d; X/ m3 B/ C" A   ) e! a8 k; a  k
  Ping statistics for 192.168.1.21: : a: o  }$ d9 k: v% C8 L! v$ L
  
% Z1 x2 k3 U/ f  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: " \% s% K( C- k/ g3 }! G
   . D; p9 G8 l% ^0 p) D' C- {7 p# y4 D; y
  Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 h6 Z3 f/ p/ H; O9 ^4 ^. \4 n
   4 u2 j6 f: _1 C7 S( @/ _& \
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
5 d. ^. g2 H  C/ X0 d  
+ C- @& D1 H: [. B3 O7 e6 `' d3 D# V' f  -n count Number of echo requests to send.
) o& u. s* v, W4 O5 ^8 A8 B   0 ]6 s% T  D, C3 o  G
  发送count指定的Echo数据包数。
) F# ~6 L3 D1 \7 ]! j6 b% \   6 [6 J' G' B. r) q% r
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 2 y! j: g7 q# h! O# R5 I! N
  
/ @' E1 |7 [  k2 P  C:\>ping -n 50 202.103.96.68 5 M( W$ O; r7 p0 g/ B( n
  
( ?* x6 Y+ ~+ r( i- L5 W% F$ `  Pinging 202.103.96.68 with 32 bytes of data:
! S8 ?' p9 b2 M$ O' w" y  S5 g   ' C7 {# a+ z( o. `8 u
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 Z: D5 X9 I% d7 ]7 ~$ a  B" m   . O6 p* h0 o: _1 C* v+ h
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% i' j9 k9 |7 O/ [( m  
, r$ q+ o7 X) J4 `+ a# H  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( ^1 @6 h- V2 [  
8 o# p! M( G: b  Request timed out. ! i- a5 Z! G; z; U
   5 T6 F  y' b1 m# g2 D
  ……………… 3 o! B  f& o! I3 c: k5 a
   $ z' A; Z/ i6 @0 D' b7 |
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 o! F& X' [) r
  
  P/ @: S3 ?5 w$ H/ d* l  e& X  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! D7 y, ^) t7 q0 Z: ~
     @2 i2 L1 w5 P7 ~9 w% X
  Ping statistics for 202.103.96.68:
8 z( `9 \+ c# L, t: w, _( u) R   6 X7 c  c/ E* l8 p3 J+ Y
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: % G: A) p: N6 b# O
   8 ^9 g9 L; i# S( }7 v& N
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
8 K* M( h5 k' f3 l3 x7 S9 R   ; z4 Q7 U$ D  X9 y7 L7 q
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 5 z! m! U  i/ b2 l( _! B# g
  
" B3 R5 x. L* W. J* f1 r  -l size Send buffer size.
. k' ~" a6 p1 l2 w$ u5 x# b  j   * O. F1 P2 B% B" W
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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