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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 / ~. @( G9 X1 Y% R
  
' {; Y0 d( n- N6 \- h, [  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , D! e) E$ p' h0 S4 O. M% h
   4 j0 q( G, m5 p# o/ m1 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
# }' w( Z/ o4 N' w1 g  
) E! a+ f+ O; c6 {) Q5 Y- @) _5 h, P9 E  V  Options: 1 E: B$ p  N' x: s- M4 W' V- {
  
7 }% M1 z5 r- j1 ?4 E  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! D6 q# n0 }% g5 T" t
   2 m7 \! h$ x1 C/ Z
  不停的ping地方主机,直到你按下Control-C。
; W! k+ v0 Y4 n6 [2 F  
: u2 m% |; d# y2 _2 S2 ]  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
2 P0 P! o1 v6 X. r: ^+ d  
* w6 h$ j# i* H( m) h# c  -a Resolve addresses to hostnames.
9 q3 h5 Q+ M' B: {0 M( {" E% }   ! G" j( l# ]  `
  解析计算机NetBios名。
, ^. x% u/ l& S9 w3 p" y  
0 g5 |/ _" a" f  示例:C:\>ping -a 192.168.1.21 / T% R& c* f; ?; n9 m) T$ x
   ; Z3 N5 r/ Y3 u# S& R+ m
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 r/ S* \" l; L; h0 D   $ B5 R2 k7 q; ~' D* y0 g
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 Y& E5 {4 O5 E" q' |% I   ! A9 \( B/ u7 w  I: q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - P/ ]& m9 o6 I# t  P6 a& N
   . [2 h" T+ j) }4 k; h6 r
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : C, R1 [) [4 p- y* m, P

  ^# k  R7 k' }% K8 t     _! l, n7 J$ G. i3 a5 A
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( j/ k" G% `, ^  
# A% ~5 _# }4 U& Q' v! z$ L  Ping statistics for 192.168.1.21: ' J% ^, k; h7 p& P
  
# Z/ j( A2 R4 V2 g  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 1 E8 E- i; Y# s- i
  
- I6 X+ i0 i1 s" q4 V' G  Minimum = 0ms, Maximum = 0ms, Average = 0ms
8 {2 `( D  e4 K' F/ }) b, G  
# w4 W6 v; ]0 h+ s5 A  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 7 O( E& I1 j9 M  s0 {7 V
   - I' G% t6 S/ u3 L) J
  -n count Number of echo requests to send. # @' Q1 b4 }1 z* G
   8 V( r' v4 B0 S* T0 u( e- ^5 ?9 h# v
  发送count指定的Echo数据包数。 0 K% ~3 c1 M$ o8 _9 Y5 r0 U0 r
  
. P2 A5 E- v1 L" P  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; c0 f9 n# T) v% U$ {% T/ N
  
! _* h1 m3 ^, A* m1 B( V& U! ~  C:\>ping -n 50 202.103.96.68 1 U% v0 m) v6 M; h; q; k5 P
  
5 x, b: w0 O) V. g+ N: e& T  Pinging 202.103.96.68 with 32 bytes of data: ; R1 p# s5 s7 C# {+ i: J
   9 W0 `; \. K! M0 O1 Q
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" X* V# }+ s$ S$ g0 ?& q   8 d  [- n; w+ O) ~; e# l1 P9 e. U
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , E! e4 K* |2 p# Q9 M4 N+ j5 g+ r
   # C! b0 \0 J, p) D. k+ S2 N, s
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) n: [7 a& p$ P; U( J  ~9 {9 D
  
( v% t% P8 W$ G/ g8 J0 X  Request timed out.   m! D. q5 m! `6 a2 q
  
: L" c* X$ L, n1 |3 k9 m! g  ……………… : d2 f2 T5 n+ N% v2 R2 }
   5 F8 J1 S" K$ [' m8 K- O  j
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 u& F1 ~; v/ {0 x. R: j' g3 Z
   , I( s8 M* S7 m; [
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! a0 f' G9 x/ K, K
  
8 d( |# t8 V4 D! [& {% T4 v  Ping statistics for 202.103.96.68: # ]3 ]5 @$ B: p3 K/ Q) Y
  
) A8 {2 e$ ?9 `; \) w- @( d3 n; N* M  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: : d' E+ b# g: W3 u) |0 ~/ q' F
  
" d, W2 W* o( |0 P0 H1 x  w  Minimum = 40ms, Maximum = 51ms, Average = 46ms
3 S7 I2 C9 @+ T3 |. n0 `9 q   " a8 c# E! L( b' H
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 : _' I$ J' U: i
     b  a' k0 N; O: p0 ?5 B
  -l size Send buffer size.
3 z, G/ Y! r4 S: v$ g; K* D6 {$ W% \   0 C9 Q' E* i5 l$ ^
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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