Board logo

标题: 教你正确使用Windows的Ping命令 [打印本页]

作者: 野人e族    时间: 2008-1-27 22:16     标题: 教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
2 K; U, y; }& H/ B$ @9 m   ( m0 s5 @5 S- J
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
  v- ?9 b1 N# `   # f5 _. F: W% Z3 K/ w5 P; Q
  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 ! \" K+ P' p9 h
  
9 s* i0 ~' F2 u5 o; U- T  Options: & _) [4 H* N0 l
  
* q1 P, U! l1 U# }5 ?) c  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 S4 y2 S6 Y4 N% M. M/ n: |5 I, |  
# u3 H1 X8 T' `* ]2 l4 H  不停的ping地方主机,直到你按下Control-C。
/ }3 @' t) r4 b( A/ o   9 Q8 U9 r$ y8 J6 n( l" c3 F
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / k, N9 @5 ]2 `, `9 k
   , V# k" h" a) V( [4 C' {- [. R% L
  -a Resolve addresses to hostnames. / ?9 |% O! }0 s7 q% f
  
' e; O% c! ^7 Q) y0 J1 e  解析计算机NetBios名。
- u! L* a: f" J$ _, k9 ^' r/ [   ( b" ~7 W2 g- r1 l+ l% o4 I7 h, W8 r
  示例:C:\>ping -a 192.168.1.21
% J7 o$ _6 e# ?; j% E, g; J6 c   # e, e. b/ m& f% G4 L4 A; Z
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
% ?% C& x5 C* L, F) `0 v3 c   " T1 J" p8 g* b" L# Y1 i. v
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 |1 Y6 N8 {- ?7 }! w
   ( w: u( V/ s( P: l/ z
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 o! w2 b/ o8 `  m) m6 z  
3 R2 b0 k1 |7 O: H  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 I0 j6 T- D+ Z$ C) `9 U4 U* H3 [
# |) |) |' N$ v: M( R   3 U, C- u5 ^) D$ r$ M
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , F: m% n% R# x- n( V
   0 [" ]% C& c) M/ \
  Ping statistics for 192.168.1.21: * O' z  J% I; B+ K. f! J/ X( N; n
   / \) v% N1 a1 Q0 r$ e5 c, ~7 _
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
  b0 N" Y) H3 I2 N* O8 J- i+ j* l8 M$ _  
% F( a5 j3 p" a$ }* @  Minimum = 0ms, Maximum = 0ms, Average = 0ms
8 q% U2 s& g' z: C6 @( |  
' y- N0 T. y& j  [: f7 D$ _  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
5 ?  e+ x( a) E  
/ w( x/ p7 i9 B$ \, C& {% U, J  -n count Number of echo requests to send. / W2 b$ }& M& Z; D& _% d; B
  
' i# h% @$ J: U# ~7 ?  发送count指定的Echo数据包数。 ; }. _& H- k' M3 |
  
4 l7 W' n% g, f0 s% U1 q% K  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
8 j" c" r8 [$ G, N& A  
% V9 [5 m$ B, ^2 i3 o3 j0 B; X  C:\>ping -n 50 202.103.96.68
: s0 G$ F+ d: i- Z; z( |   - `2 z0 A3 `# u) k/ ~6 Z' F$ d5 p
  Pinging 202.103.96.68 with 32 bytes of data:
+ v/ F$ x' ]5 p+ V7 D! n- W; b5 b   ( R  g$ `- [6 c9 N
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / p9 x3 u) V; p2 v
   . C8 p9 J& ]4 j* x% O
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 J# z" {; ]+ F4 F   4 M- x% }5 F9 F5 D' Z( N/ {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 q0 _8 @, L7 {$ D8 f( Q% X  
$ m1 n8 y/ s: _2 R  Request timed out. & E+ a* ]( M( ]" }
   8 C! t4 T" Z1 M5 W; B) r: [) e
  ………………
3 T1 G$ x# w) V  Y+ X   % b! s! z& j5 g& o/ u* f( k
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % D2 V7 i8 D  g, `; s
  
7 \( h! v- i7 F* ?* d  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # C; w0 l: V. U
  
4 n. y# A5 i; J% R( P  Ping statistics for 202.103.96.68: " Y5 y; b! S) ?  Q0 Q/ I* [0 f
   , ]1 B+ I# f3 r0 \1 }1 S
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
% [& h' p, M: s9 Q4 j1 f2 P   $ g/ h* d+ B; C- `& x6 T+ @( D
  Minimum = 40ms, Maximum = 51ms, Average = 46ms
- F' h. Y1 j, X9 v5 z7 t, ^' s+ a  
' n- l  @7 K2 [" k1 [* A  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 6 a; Q, w. O# i, u) E; z1 L, m
  
* d( X' S# _0 L1 @  N4 M, @  -l size Send buffer size. 4 [% U7 J0 n. p1 M
   " r2 O5 x0 T% d. u
  定义echo数据包大小。
作者: 冷雨清心    时间: 2008-9-25 15:54

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




欢迎光临 捌玖网络工作室 (http://89w.org/) Powered by Discuz! 7.2