返回列表 发帖

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
3 \( R1 v& P9 a% [% X2 J, z0 @* |  
* a& A/ S* G5 Q5 Q0 I  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 9 w& }7 n. ~1 {
  
( w4 s+ F  ?! z  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
+ `, x* s( S5 \7 m8 e   % `- o; |2 U8 t! ~; H. ?  P. R( L1 [" Q
  Options: & M2 P: [5 E# f/ |* t
  
. Y. w: W, ~5 Z( B7 ^  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. # n% j9 d$ P  g; p( M: F0 K
   / l. o. Y+ E8 M6 b2 ^$ B' e9 q
  不停的ping地方主机,直到你按下Control-C。
! E5 o( i/ Y+ y6 B, V& ?2 i   : l1 }# ]# @% a' s& ^
  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
$ O/ g. t3 }. p$ h* b   % [# P/ O0 f; `$ W+ I/ Z
  -a Resolve addresses to hostnames. / s: c3 A6 t) p* ]1 t* n) `' n
   . C* ^6 R3 N% X
  解析计算机NetBios名。 6 X5 b7 p4 W* v4 {3 M: e
  
2 A6 ^4 W- B; T3 d. g4 f  示例:C:\>ping -a 192.168.1.21
; }9 d" z( I% U1 p$ s     F* W" p. R1 _$ o; l2 ]
  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! Y& T) s, w# x  l% V; K9 O" V   . s5 w* K) v& ^' @& m/ L
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! |1 l( P- V$ y; F0 t5 D2 F9 c- K   2 {, ~. }$ k$ C- U% _& K
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
  I  s. q3 N) @6 R; J  G  O  
; ?9 I5 Y1 B% V' R# e; K2 S! }  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " q3 Y' |# L; j$ S  K3 z
& \$ d, c/ ?. ^$ {5 o  J
   ! Z) X' ?1 B  w. \% u
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 _/ z: a* ?0 N9 V& ]+ q- P
   7 f& Y" J& K+ s) C" R5 l. K# \
  Ping statistics for 192.168.1.21: ' e, `7 p7 b" \! {& v
   2 L- Z* U5 n( V; [
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
6 ], e% ^. H; J$ p, Y' R$ a   ( J6 L/ u' J$ K: V* `" K5 ^
  Minimum = 0ms, Maximum = 0ms, Average = 0ms
) v3 e' S' k) S: X  
) t$ [2 a+ ]* f1 C) B1 B2 e  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 0 O. }" `# o! ?. ~
  
+ V5 n# [0 M' Q1 G+ ~* B+ P  -n count Number of echo requests to send.
* G" e# W1 S& ]' l/ Q; k" y$ ?   $ k: C! K! M# B: \% {; x
  发送count指定的Echo数据包数。 # j( F! T* Y3 c9 t
   " |. {1 i8 X9 P) v3 k
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
3 {" L6 @$ N( ]$ Q   7 M, _( B  u# @! P" p0 ^
  C:\>ping -n 50 202.103.96.68
$ ~6 q# @  |! `' m  
; _) U1 Q0 S& X( f( i0 b  Pinging 202.103.96.68 with 32 bytes of data: 7 [; R# ~& Y- D
   2 Z& j1 E0 ~9 a, W
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 R  w4 @, v( ?% r& Q0 }8 o
  
/ S; Q6 `* V# B% ^1 y  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , d- G$ \# P* ?! q
  
$ v: e9 @4 z; _/ u  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, s# |7 t* [' w   $ g8 y+ s! Y. j2 ?$ w3 h9 G
  Request timed out.
+ D3 @1 Y4 S+ @   / C9 `, m, R  k3 o, \- S
  ……………… % _" E  S% o3 Z( O: w
   - h) M: ~5 r/ U8 r
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 y5 M) O! W2 U  
) W3 `% o% s, p+ z5 T7 R  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& I9 g# p, M* D: W6 a  
, Y6 W, ~. V2 [. f4 S4 p  Ping statistics for 202.103.96.68: 2 i  y* b7 v2 i* {6 m
   * g5 _: F  h5 U" H" o5 g
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 1 j' i* F1 G2 @  _0 T
   5 @* H& ~' B7 N
  Minimum = 40ms, Maximum = 51ms, Average = 46ms " v9 ]6 I9 q' O5 u0 i
   ( e* f2 h3 }* [1 J& `, p1 {8 n& C) f
  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 , x3 j0 R' P6 u; A
  
' q% E! r# F- @  -l size Send buffer size. * w: o7 C: c  T7 e; K
   9 Q- B3 u0 o2 t( |. w: X
  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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