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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 % R- w' S2 a" i# ^+ e9 i. O% h
   6 u8 A- S4 z8 b, C) [5 _
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
  g) k# ?6 A1 E2 F) Z# H+ I  
3 W6 k3 }$ ^0 D! {  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 0 ~! P/ f9 z# V  R% Z1 U4 g6 m4 Q" l
   6 y9 U  s: ~# D1 Z3 i2 D+ h
  Options:
# _- \! F6 ~, p% d0 _% {   - B, s9 W8 O  b3 a) r5 u
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ) `( P0 R, k' H7 W# C: T
   ; N: W/ Y) O& f% {% W
  不停的ping地方主机,直到你按下Control-C。 + x' `& ?$ L* ~6 |& Z
  
3 B; @; W6 ~  a6 L% _  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 j, }' I# ?2 I7 D+ v
  
1 z% w4 g. U4 Q* d, _. z, b  -a Resolve addresses to hostnames. ! ?# |& y% D5 ~+ e( A) `- p
   1 T( O+ o" z- q3 e
  解析计算机NetBios名。
  s/ x3 n) V7 o1 ~1 C   : e! m0 o0 R' C7 O, l
  示例:C:\>ping -a 192.168.1.21
. g1 c, A$ d: S7 C# p. H6 q5 Y  
. V% j. S2 z: |  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ) ]5 _$ O+ L& ?1 d( F1 N
   5 h" {. z6 T. Y' {9 o/ o& K9 H  D
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' A9 P- D3 l7 i8 p4 h6 j   0 ]# A+ s3 Q" o
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ u, I: V2 h) ~$ F$ s; U   * o$ q3 R. N+ V% O4 \
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ t) r' s. r( @& y) M1 d& o5 j% O* h! P% T- R) q6 Y3 k) j
   # W/ D! L( t0 W1 a+ O& Q
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 i: z$ T6 m4 [5 H
   , X2 y6 N5 t2 K9 i4 l/ ^
  Ping statistics for 192.168.1.21: . n: F0 }& U8 R+ L% K" H
   3 Q8 Y9 Z0 K; J( @8 a9 p- Z
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
* |; l, b( e; N" x2 r! s* Z  
8 j9 z5 v2 O+ @$ A5 N4 G. g  Minimum = 0ms, Maximum = 0ms, Average = 0ms - j) y4 |% R0 Z( h
  
% R$ F% c8 r2 J. Y8 @  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
, ~" x' ~" J# z; Z& ?  
6 K! L$ K8 a, }3 ?' N8 R* X8 P/ u4 V  -n count Number of echo requests to send. ! J; M3 p6 l" s9 s9 o
   ! B8 V( F' ]* r. `
  发送count指定的Echo数据包数。
- `2 E$ A- ^0 X9 a7 u+ r1 x9 B- C- E  
) w# G/ u& u! o4 v5 \8 f3 g# c  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: & C  g9 r0 @- T) W
   $ S- {1 P1 p; X% o, C
  C:\>ping -n 50 202.103.96.68 $ C; P5 x7 D/ T
  
. m# E: V; S4 u# h, V8 B: I$ K  Pinging 202.103.96.68 with 32 bytes of data: & s  \  r' d, ?! S# e1 s) B
  
! R8 i' ?! X! c4 P9 g' |  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) g' X: ?- h+ a  L3 R7 Y
   / O7 F- l2 S: l- ~
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 & J" Y3 X, u* Q" O) j/ I: M+ L
  
( ~. v& q: ^3 ~6 @  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, }) H+ D$ M. w: o* ~) o6 w6 D  
& L" @- K, K6 r7 G" y  Request timed out.
; z7 e, v' G- o* s9 R8 G  
$ E) b2 Y9 A0 E5 h  ………………
- q: n  v) n7 c) t2 o; D   ! C# M1 j7 ^% r# a/ C% m1 j  {
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! p: I  v5 Y. r& T
   ! Z7 W) G# u6 v
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ P3 `0 p& d$ w7 u
  
/ Q" B* K6 a; O& C% |- J0 y# O" @  Ping statistics for 202.103.96.68:
4 F" |1 o! ^, ]) a/ {  
! t' d5 x( \1 A* ~9 O3 T! R9 o  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ; @7 z" {8 o' H. s3 B
  
. o+ Z+ m4 C  l, Q. s  Minimum = 40ms, Maximum = 51ms, Average = 46ms
. }/ H7 [, l: U0 d   ' L" J! N3 ~* z" i. Z
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
2 y& T0 P8 t. U" K4 |: ^$ m   0 L) T% V7 @; i6 E
  -l size Send buffer size.
" t7 j$ F; i4 G& p9 _# L" j/ }% f! E; _  
7 ]% R0 H  ?, B, r7 k/ Y# V2 Z* F  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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