返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
/ P- @9 y0 o6 O& m$ u2 f# F, z5 g  
- j* C8 I1 ?) B/ K7 E" g- {  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 9 C) G) m$ |2 r3 Y2 V
  
" D/ l0 ~$ I3 O2 ^  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
# a) i8 q, i8 u! l* ?1 @   2 J$ ?8 G8 }( i. F& f7 y% l. ]
  Options:
* g2 c, s, ^& W$ i$ q   ' w- W# _0 P! n) W9 i
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 E9 R; A5 \, G5 b1 j" t  
! u  [1 s9 @# k: ^( p  不停的ping地方主机,直到你按下Control-C。
) J/ h+ Q2 C. o9 k     u+ x/ {# Y  c
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ; h. o1 C  ~- I' p2 \( Q* S* B4 e6 T
     T9 N. h5 {$ p: J% f. T
  -a Resolve addresses to hostnames.
2 J/ \% d! X+ q$ h  Z% p  
* R! ?9 P  O  j: ?5 w4 U  解析计算机NetBios名。
% x4 r. j- q! r   6 b3 S  o! F" a) c1 S
  示例:C:\>ping -a 192.168.1.21 ' i: l# e( y& t
  
, M3 \& Z9 o3 t4 ?  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: * o8 @: i/ G* ], \
   * e: V! _. @6 z* _0 z, ?
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . y" p/ f% a5 x9 J) l# ]& G
  
+ q# ?3 _9 J- _/ o  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * T/ @9 F- w9 g% k0 H
  
  @3 Q6 v' c6 t7 N, K  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 8 i" n$ T+ j& i3 b3 E- ~- T

9 {  n2 c1 [+ Q7 ~6 Q     p$ N/ n1 ^: {* V
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ m$ }( }9 a7 |; w7 u+ O+ Z7 S
   % G7 W3 H4 }. ~, G1 {! z
  Ping statistics for 192.168.1.21:
3 z7 r+ j- l8 }, e1 F/ M   7 y; n& g9 G* l& w5 `* ]: J
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 1 P0 r# Z! g, |: X4 r
   5 P3 ~( H) |1 }' m2 m) y
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
6 `, v/ t" n3 ]5 s# s) M8 B   % e+ M8 `. V! Z9 V
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" ?9 f  G. C9 Z; Q$ p  
! |) s& a* ~0 l" Q3 }  -n count Number of echo requests to send.   A5 O: d! S- O" h+ Y3 l% a' o9 W
   + U& I3 O( s% o  \5 R
  发送count指定的Echo数据包数。
* A5 q7 r+ f4 s1 J4 S4 Y   4 U4 I, Z3 Z) J
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: % P$ @. K3 a; t4 P
  
3 ^. ?% Q$ x4 G, Z3 [2 N  C:\>ping -n 50 202.103.96.68 , k. e! G( M2 L) {
   & {6 [8 g3 h1 y- k$ h' H/ H
  Pinging 202.103.96.68 with 32 bytes of data:
8 W/ _) z) P! }- W  
0 i4 p+ T+ U* b6 ?/ X. ^) z! z  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % ^( z; G5 p1 j- m6 _& w
   7 Q( \5 o4 m7 D7 L4 p& F
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, U) N; [% e( @; a! {3 @" K5 Z; R  
: B* x( `6 B" s: Z6 v- K5 p$ D1 r  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ O# K, E- X: ?/ ?; `7 e4 [) u, V  
0 @4 J6 K* c5 o% f# t. l5 Q  Request timed out.
7 a5 @: f6 v$ H$ `9 h  g  y  
. q2 X  M& J0 L: W  ………………
; l2 k2 V% z: m4 t   : O% `3 t# J2 J' _' x2 ?# i6 X2 n' P
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! n, _; R2 e2 o. U9 N: x
   & D8 w( v; P+ W* I
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - g) e# h% R# t+ `  Y" u! w
   ) Q' [% \7 h0 w0 r
  Ping statistics for 202.103.96.68:
! a5 V8 Z: ?1 N: Q3 i( D7 J  
  I3 r8 w- J3 m- _  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 f! T0 I1 [* d
  
) X; Z: `6 l6 |% b- N0 @  Minimum = 40ms, Maximum = 51ms, Average = 46ms & d6 s2 }! D1 {8 s8 U- W5 {/ K
  
- _7 m% m) e2 K8 C2 ?, c; p6 e  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 1 g; }+ x: _$ U1 t
   # \0 q/ u& y, j( r7 R8 F5 B
  -l size Send buffer size.
, B: {, a. {# N0 S  
9 R5 B. W. l" x  V5 }/ V+ m' Q. `  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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