返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 # W% ~& m: d: V( f
   1 J2 A5 q* [* J, R0 S. K8 ^. u
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: * r- x7 l$ b6 C
   # e- O, }$ [! G* o- b9 i
  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
# p! r" p1 g: f4 d4 u5 J  N   # X/ P$ [% ^! h- r1 F* W
  Options:
+ H# t0 _3 L1 y, r7 |3 b: P# }) h  
2 w9 H) \2 ^# }5 x% S  R! r8 f5 r  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - n% {1 c2 j* G) d( @0 `7 z
  
/ s$ v7 I! b4 o* j5 H+ y, Y1 b  不停的ping地方主机,直到你按下Control-C。
0 P* J9 b/ J, K' Y; |* v) s   2 B7 L4 H4 n0 @. c3 c' ]
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
/ T. Q6 W" a  O  ^' W2 C( e# y  
: m- r7 }0 A6 ^$ a9 y  -a Resolve addresses to hostnames. " i3 B" O7 i, a* R5 K  }0 G" ~5 p
  
( l! k! V0 R6 Q. B6 q  解析计算机NetBios名。 : D" R* f' l+ Q, S( f+ l) l- x) r
  
0 X: S  E+ ^! `( D$ a  示例:C:\>ping -a 192.168.1.21
. V, ?4 z6 T9 x, ^6 Y4 o0 T  
7 G1 s5 _( h5 _/ p* u2 R  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: - M* O! p3 P$ {3 b6 `
   # g3 \! o) V: b, Z) @3 O( L3 D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + S3 _6 N6 I# p' y0 M% a
  
9 M( a& P3 f' |1 x% X! [0 \0 s  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ l- m# e1 n; L) {4 P
   ( Y% l( o( e1 Y% _& O
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 X/ R- p, a* D9 D+ A. ?* o* H

2 A) j; ^; G) _; w4 z2 R. P  
) [& w2 z4 E5 a  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 {. k' Q$ B( z; E) V% |& w+ i
  
" o4 M! w/ m& R1 Q5 |- E  Ping statistics for 192.168.1.21: - h. [* v% N" m- U. U" D- g
   ; n+ r1 K5 R- I5 T" R
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
# o. t& d4 m3 I/ t( j; f: ]   / m+ V; D% ~  g3 b( `3 Z4 Z
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
; u2 y; }& y# {, ?* ?   % \# X6 d. H: U$ J& e
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ) @) e9 `+ |9 e8 o( L1 X
  
1 z; R) A: @7 k9 o  -n count Number of echo requests to send.
- P0 H3 K, r' P( i* W: Y   ' ~, [3 _: F$ l2 K# m5 H( x
  发送count指定的Echo数据包数。 + I& l& d% q3 ~0 I
  
0 z( A0 a" |" \$ Z- t+ a  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
7 s% O: t* M3 {  f; Z( x( Y  
6 x/ X+ D, N& O" v  C:\>ping -n 50 202.103.96.68
" D3 h0 s! P6 m# @  
& R9 }& q9 J/ j  O4 e/ E" ]  Pinging 202.103.96.68 with 32 bytes of data: 7 q$ @2 d7 q/ T, M
  
' j! f% [! U0 @8 V2 D' w( E  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: q0 `8 e8 ^7 h! }( _1 p  
7 Y" u7 S0 L. I* x  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; K  B+ E1 V2 ^% ^) ~/ _
  
* _! b8 l' t5 W  Y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # g9 Y3 S, `8 y6 u( l# L
   8 i. D  C: \! x9 g1 T# U
  Request timed out.
2 |2 p; P/ u( g* W+ v   5 X9 @; {9 x3 O( D% |
  ……………… % i) A/ u( `$ {( {7 |% f$ N
  
  a" }) V$ W- o* Z1 M3 U9 [0 J  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# `+ H  x0 I: b1 ^$ F- o2 j  
1 I% c$ ?: i' t. B6 b  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241   D8 P' z. P' r. W5 r- p1 c2 O
  
/ |4 A& g- j$ _9 l  Ping statistics for 202.103.96.68:
/ B3 D! E2 J& ~# b/ U; Z  
1 D) M+ Q: Y3 I: Y7 y# x  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: : c  J3 U$ @, ]% e: S8 y* k+ _
   ( J: v! \% R6 {9 b
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
( Q4 [; h/ Z2 f  B  
4 T& G: `0 B( T  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ; H7 i* o- e0 K- R0 V  H2 V( ^
   ; \* H, R# J8 I9 r2 \/ M) m
  -l size Send buffer size.
* v0 W6 t+ s) p9 \1 T2 `% R: P   1 {8 p/ Z+ q9 c
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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