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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
" P) j5 g- _9 l) V   / s4 M( w( g5 X) F1 g- @
  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
* h$ E( ^: I) K1 g  @; C/ b  
& i! f3 I+ o3 u  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 3 C4 r" P$ D8 a  A
  
) d8 U8 {# m- U7 W! d  Options:
3 S+ b+ M) m. J   9 X- k8 F: C+ `2 F% P, w
  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. $ x2 \( @' s1 ^/ r: _: `8 h1 y. g1 s
   # a& m& n5 f) T  L
  不停的ping地方主机,直到你按下Control-C。 : _3 D- X, C8 `+ V2 F
   9 f5 D# O3 G; Y0 X& B+ m
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 / ~* J4 s8 e! G
  
4 m: ^! i" C3 c! [  -a Resolve addresses to hostnames.
* F! m/ o/ X) \6 w/ a& E  
+ h, {5 _* R9 ^' A8 a- C  解析计算机NetBios名。
0 y" q$ _# D5 \3 Z3 U   / z% U, i3 {4 ^* Q: }$ b
  示例:C:\>ping -a 192.168.1.21 3 V8 `1 k3 D7 W( W9 [
   : K- d( D  l" M6 u8 d9 x" ^
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 9 b0 F. t0 i0 e" U% ]
   $ D$ Q+ {. M- z9 i7 u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : Z5 t& y5 w0 C# P1 Q! J2 g, L
   & R. c, G" R$ F! B( l: c% S
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* U3 k  Q% u6 k8 u   . _. A0 |0 B5 @4 j) M  T
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" H/ q. X: U* \
- F8 c) d2 o2 ?5 B: s     c8 w; l! s2 }7 T9 c
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ ?' A4 Z- k" o" u) ?' `- d3 l   1 \# \" B/ p: o/ P- y' X  s/ u
  Ping statistics for 192.168.1.21: - R# }6 X: t1 |, |
  
2 b* ]" X1 q, ^& w) @  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
! ~; T# w6 {5 m; H7 @  z& t   4 O4 V- y' _, G" s- a
  Minimum = 0ms, Maximum = 0ms, Average = 0ms ; R* D# L- ~& P3 G
   " L# Y9 S# @4 Q2 H/ h  E* d! _
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 % a! B/ K3 b' \4 V
  
+ J3 r  I' a$ O, w- g6 P, A  -n count Number of echo requests to send. % I* ?1 M8 U  H! ~6 P4 _
   ! T7 j& ~1 g9 ?* C5 ?
  发送count指定的Echo数据包数。 $ N3 L+ s9 N" ~8 i
  
; W% I$ s% M' z# ^% a( H8 o  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ( x  M8 Y  V1 x6 h+ v1 f* ^7 t
  
; i8 Y& _' t- V  C:\>ping -n 50 202.103.96.68 9 B$ a" b7 m4 f4 t2 F
  
# h8 l( ?9 p8 T/ \. Y  Pinging 202.103.96.68 with 32 bytes of data:
2 U. g% U# B( J0 F3 o  
' h/ c6 R- Q0 ?+ f# _: W0 W$ l  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 {  H  Y+ @; Z6 o& W
  
/ f7 d/ q- q  f  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # j* z# Q; v* }2 o+ J+ |. V6 l" x
   ; m0 Q8 Q% E0 h# {5 g. V" a
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, N! y: ]' a: H* {2 Q  
# U. z5 m$ A/ _  B! b; k! Y% A  Request timed out.
  V. ^; G3 r. U+ c6 p   " q9 p0 M/ I8 \& P# \
  ……………… ( ~' P0 \8 M0 b* ]( B
   3 v, I: U9 I, M- {& [1 V6 @( O5 @
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # }' w  o: w& Q
   ; S3 B- _- C) Y3 Y1 y
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # c. S) I; O& E
   ; h& F  b. S  u* c1 ^, w9 E9 `* i' l
  Ping statistics for 202.103.96.68: 9 b5 S2 Z& O: d6 t6 X; \
  
! ~9 _" w8 w7 H% F3 ^2 X  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: + C0 I8 H2 ~8 G; `7 x
  
, z0 n) X) {/ l  Minimum = 40ms, Maximum = 51ms, Average = 46ms
0 V2 x1 V1 M+ u" n  `$ j; `  
6 y$ A7 S( x* `3 S4 n$ q+ R9 }; h  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
* V, ~9 l6 t8 z( ]! w/ M  
% ]" y) s1 ?& `  -l size Send buffer size. ' h, ~6 e6 }0 s
   5 N  g) H1 Q) z0 p% W& L$ n" D7 B
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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