返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' s$ M/ U1 w$ n  
; k  L( ]/ Q+ X7 c% J8 f; e  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / j3 E, P2 j6 @: C) ~/ C6 t
   ' A, W; B+ d0 }3 h/ {0 f3 \3 k
  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 9 a% {! c- Y8 o& @
  
2 c  s+ ]9 f0 n$ r6 \9 G  Options: 3 F/ W, M6 q! w; r2 S* c7 y0 i
  
. [7 I% ]$ c/ r6 R  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. , u, d  }& S8 o- s" `
     z! n1 k1 }5 M" s
  不停的ping地方主机,直到你按下Control-C。 6 x, J- X& V2 {$ H, H' W
  
" y2 t; \& d  J& X" C- X  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ' j3 q/ [: i0 E+ {
   8 ]- H/ d+ M- ]6 R+ ?) X' {
  -a Resolve addresses to hostnames.
2 R2 y- g6 E' d6 F   ! _$ a5 c( G7 g$ ~: D
  解析计算机NetBios名。 4 @. v8 j+ G  }: q. n2 v' B  ?
   - @; P' B7 r; p7 O2 ?  x  x! ~5 a
  示例:C:\>ping -a 192.168.1.21 $ {9 ]  i0 k! n6 Q
   4 S; i1 {% L% k- @
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
, @# L6 B" b2 x5 o   " O' x: S8 \# w. k
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 X( \' _& o! d  V5 r/ Z+ x
  
' R# W0 s/ F5 L! c  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# g0 j; _; Q: E8 B- ?, [) H  
4 `2 l3 s) O: o0 T- {  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
7 g1 Q) q) [% l1 ?7 E2 j" Y4 W7 B
& B6 e% U  Z5 N* x% _  
3 _* ]' T: I/ \* t( p; A  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , I1 D. T7 i1 \0 H$ t+ ^: t
   6 Y' q: |# z/ ?3 Z8 U1 m8 Q5 \
  Ping statistics for 192.168.1.21: & F# v2 a5 U! |4 @# k* q
   5 V2 x0 \; a0 n  r& J
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 3 z( K% M) l) T4 o4 u  X' f, U; t
  
% V4 @4 E, `* N. z) C  Minimum = 0ms, Maximum = 0ms, Average = 0ms + X/ A/ f+ G8 Z0 a8 N! @6 O
   9 C8 j4 A! e4 \# M# s9 p9 j
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 : \0 a- S, O$ i4 M" ~% m
  
4 Q5 }2 Z( w+ `, Y3 d& x  -n count Number of echo requests to send. 9 f# g# K4 O8 _7 P" @1 `, y; b: w
   ) J. z1 U: `9 j) F! H+ ?4 L
  发送count指定的Echo数据包数。 $ e' \5 F# f0 r" C
   9 F$ u; }6 m- R: `
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
  h( c- i% i/ a/ h0 h( W   4 O0 W0 x  E$ p" ?& C, r$ \6 ]
  C:\>ping -n 50 202.103.96.68 0 S4 I+ S0 |, A' X" h
   0 F2 x; B: N: a8 R& y  l2 @* Z
  Pinging 202.103.96.68 with 32 bytes of data: . S$ V& {% h1 I
  
4 |* ?  ^. j; v: P  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
  o( ?$ [+ E  V   . j  ^( l' Z: \9 j7 `
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; b! X' c& S5 _; f$ T# D   - w0 K, p+ ]% V; A
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# k2 ?( ]' Y: F/ }. G$ ]6 U; n   5 H0 P. N0 i/ U3 \7 u
  Request timed out.   L# K* R4 W3 w% e% @6 \8 ~& J4 F
   ; O$ s) L( G' [* g
  ………………
7 c) X# ^; z! Y1 k$ A. W4 c   9 c, \9 U- d! a
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 Z' x0 m! p. U5 P) O3 W0 A- e
   $ h! j$ L& V/ K8 D0 Q! v# ^+ o
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 n5 c1 r1 m, d& ?' l; d  
5 g7 t; ?  U& ^; L: `# z# L  Ping statistics for 202.103.96.68: 3 q. M2 n; ]! B! b. A( G
   5 u# i7 f& o& g( O+ u
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: " ~) b$ {6 m, Q. Y! D
  
. w; u2 S$ X' H5 P5 K2 V* q6 i  Minimum = 40ms, Maximum = 51ms, Average = 46ms 7 x1 l* S% l% w: [4 J. E! H3 J
   . l) n7 A! m6 D! E- X- `
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 g& r6 Q* v5 }+ N* ^' C! L
   9 J1 Y6 \* h  `- A# S* |* b  u
  -l size Send buffer size.
- R% v. Q( g4 D* G  `  R% Q   3 Y# S! L3 T% R+ ^& `
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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