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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ; c: u0 m" x% W3 s9 {
  
! V# M# x, l) o! V  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 2 l3 Z# {8 x% k$ V$ X
     B$ M8 ]4 B* e7 Y
  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 3 `0 V6 \! _, e: U! c2 A
  
1 h5 x. A7 j6 w  A  Options:
4 M# }$ }3 I. T  [. ?6 ^5 A) Z  
0 e" N( W% j" S1 B- M, \% c  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - O" i0 Z! U* ?5 s6 ]' k
  
6 @5 w; ^" t9 G2 D( H  不停的ping地方主机,直到你按下Control-C。
+ _7 _# }6 H; i. v5 s7 n( m  
, a( V4 C$ Y" r5 ~% y9 Y4 y  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
$ h* t* [$ {1 d/ P7 A- d, [   # \0 f: |+ Y0 @) O  ?# A+ Z
  -a Resolve addresses to hostnames.
4 d8 P" _1 n4 J' Q, [   $ ~( K* M3 ?6 s  O. q& a) }
  解析计算机NetBios名。
0 r- D7 C, ?$ m6 Y1 o. u$ r; p   % X: c! n2 I4 g7 n1 y
  示例:C:\>ping -a 192.168.1.21 . E% F. |/ }" P5 B! f8 D8 z
   % i- U# N7 p/ N% T
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 q+ x7 X' M8 R- C- D  
, a6 @% R4 C+ x3 V" H5 v1 M  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 E: ^7 v7 \3 t) q5 T; @  X
  
5 P" C8 h; k$ M  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. Y# V4 w7 {' D- m% M# p  
6 Q% v3 v5 n3 b) A* Q  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254   U" b$ B$ W; q+ M+ `% l& C6 R
; _9 s$ v" s6 d9 m; @
  
0 i6 i" Z; x) D0 j% r; S) l6 e  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 q. r  y/ @# S9 ?0 k0 W: ^0 F
   & P% U5 j6 Z3 m/ V
  Ping statistics for 192.168.1.21:
$ x# e7 r5 n/ P+ c+ r% _; ~/ o8 v   $ g% ]3 N0 A1 T4 t* R
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: / i3 f' h6 N5 \( I9 b# E: D
  
- u' _# H8 k1 H) I$ Q0 f  Minimum = 0ms, Maximum = 0ms, Average = 0ms + }- g0 ~6 N- v. h
  
! ~. p- _, h% D  }  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
* Q7 C. G3 r; W  
. [4 S  V0 o4 ~! ]# s  -n count Number of echo requests to send. 4 ~* N, Y) I5 S
  
- Z; B9 _- q$ w) P0 a, c  发送count指定的Echo数据包数。
& ?2 R6 D" s; A; v) H" M4 u  
8 d0 X% L( F' O, w8 i0 I  u: f  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
6 N7 T/ X7 M2 ^7 I2 h$ v  
! K( h( ?" K, j6 l  C:\>ping -n 50 202.103.96.68 , }$ G1 m% I. e: E+ _5 x. m: m9 j. @( y
   * \* F5 a5 v" a8 y
  Pinging 202.103.96.68 with 32 bytes of data: # z5 A! m' G# M
     N/ \" T% \+ W, e6 V) c
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, J- j! Y& K3 T  
8 x5 S5 F$ f  H  _4 G: ?9 S. x. j1 [( b6 Z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; J4 P/ |; C  a
   " B8 T3 }6 i8 r/ ~1 P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , `+ ]' N& s' @; x- c  n
  
5 t/ k1 d1 o4 d5 R% D; `$ v* A  Request timed out.
3 E( ^  {- F; |  
, m6 P/ e1 Q4 s$ T5 R5 I  ……………… ) K3 Q4 A- H  W; S5 |1 p/ v+ T3 g
   + Y7 \' _( Q) f/ f! i4 n, ?' }
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 y; T: P; t' j
  
5 }8 v: C4 `! V- }2 \$ C  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 K3 c2 r! N9 _5 _( V) A# t   & y3 U: }6 ]4 y, d) q
  Ping statistics for 202.103.96.68:
$ d5 D: i8 V0 n; }. D9 t; Z  
. k8 W% ?  P: s* O  ~9 w% `  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; Z$ P% ?; {* s" c
  
8 y' ?- A8 N" l6 F' S+ p6 a5 _  Minimum = 40ms, Maximum = 51ms, Average = 46ms
" d- e0 p" B: T" I" I# S  
( h$ q5 F( F; R/ f! \: U4 c5 v  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 : [+ |( G) R8 S6 M: A
   ' n- T" ^! G  \! `* w
  -l size Send buffer size. 7 Z' Q6 t. y5 x# C
   4 f; r7 w; I" W- w0 A2 Z/ j* m
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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