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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 0 Y$ }1 D: r3 K0 a- d1 b" l
  
' l' W! A, L3 G6 m/ y  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 8 e# x0 t2 o% J% s! [5 _
   ; q, ?6 R  R+ E2 q, W
  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 2 F  @! U& ~3 X6 w+ V# j$ X; H# Q8 W
   , Z% ]2 T+ E4 o
  Options:
2 H$ z6 W/ g6 w0 E; _5 E  
, U9 N: ~- W; ?* A, ]# v  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
0 E2 u- d$ G: {   / n. A; a8 D% ]0 o- j( Y4 x- C
  不停的ping地方主机,直到你按下Control-C。 # |1 j2 i+ H% E* T
   % n& u, b% @: {5 |$ l
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 : Z* U0 Z/ g' j+ C3 r0 [5 ^9 @; e
   & E/ D/ h9 i$ f* c5 ]
  -a Resolve addresses to hostnames. & [. \. q9 ]) e% i* b- m
   9 G" P  s5 u, C: @5 C
  解析计算机NetBios名。 ; j6 l- Z- _+ j' K- B- x# c
   $ S; e+ ]7 Y0 {: ]3 i6 _: O
  示例:C:\>ping -a 192.168.1.21
& c" g3 N- ^) l; v" E  
# \( `3 t5 r0 ?& x  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: . D- n! x2 _  ^' V! y7 c2 [( M
     r0 U/ d, R1 N3 L- f; j9 i6 A) j
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' G- i" m; @& V3 M; {
   * p7 l4 O" i! g; T# Z+ c
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : q4 @' `+ L5 Y) D3 J: T
  
! @7 {8 Y5 c' A) k# C4 {2 O  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 |) A2 C7 U) d, J* {7 i* K- E. W' E! ]% a3 b
   % a/ C- B/ E9 j  g
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- v- b# e6 W& l' W$ K0 _  c  
! b. K- `0 Q; K  Ping statistics for 192.168.1.21:
. m& Y3 D% j' W6 F  
; s3 M4 ~6 A5 `& U; Y' v: r  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
8 a2 O% s+ m0 B1 e! Y8 r4 C1 q" l  
; E, @& f/ _% a  Minimum = 0ms, Maximum = 0ms, Average = 0ms . k" v% o3 M! x& f7 S( ]2 N
   4 P3 z  k1 g4 |+ l- a2 P+ L$ a
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ( I/ ?+ |/ F# Y/ c6 _' O3 D* Z
   8 b2 p0 a6 a+ M& t3 w+ S+ }
  -n count Number of echo requests to send.
" Q, h. `& R* r1 t; N" N7 L   ! x1 ], W, r) }
  发送count指定的Echo数据包数。
4 R' r% m% ~% b" s$ C$ e  
$ S/ j9 X% n) n8 ~% i  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
. Y( [1 l1 e0 a. h! w  
' k: a; n, E4 w3 ~: {5 R  C:\>ping -n 50 202.103.96.68
1 l: S8 D6 [: L, ^  
. `2 n% Y. T2 B+ n  Pinging 202.103.96.68 with 32 bytes of data: ! c: a( r/ G# M' z, @
  
' k1 d. s& E+ G) p8 S  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( r; x5 m. N6 ], ~% G, \6 k8 v- L8 L   0 q, ~) q  Z8 G! H+ b/ A. I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 D& B+ y/ o8 O6 j
  
6 H9 B" N" V+ I: D) h3 _  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 c1 q* U2 W5 h0 m4 G. a0 L   5 W5 m! ?" y: j
  Request timed out. * n6 O4 {, g* O+ r
   : A* [; d7 J, g3 k+ T& J+ Q
  ………………
) |; N9 X. o3 f9 H  
. {1 J, r* b$ v' ^& A  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ z. x/ o- b; u# s( S: ~, N  
% U) ^7 w' m) Y9 O4 |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ Y% _# c+ P8 J  k) [! [  
9 x6 N) s$ B; n  Ping statistics for 202.103.96.68:
. R2 R  I) N  G# V$ Z* q   1 P# i9 v! p7 l2 y
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
5 X) Q9 p! Z6 o+ f   1 d# C% g! w$ z6 J
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
: G- u% K' I2 M& P& b  
: K. n; W9 |" s  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 6 V: l3 |* _) N! y% j
   . l/ B- y& ]* T" C9 _+ G) K  Q
  -l size Send buffer size. 1 o0 \4 d/ C4 B' p: Q2 ~
   ' V; l. u8 B* P0 V( ^' l/ |5 [
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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