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

教你正确使用Windows的Ping命令

  对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 $ g& p" ?1 T# B5 O  R0 a8 ]
  
4 H8 G/ v" S- [# J3 P- X  现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: + k4 A( U' E8 m9 a6 K
  
9 k7 k4 [# ?6 v. e: _  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
/ N( v/ z3 E$ z+ W  
$ x7 [" _# H, K+ ^' }  Options: ) ^% r# Z$ o# H7 W  h
  
! s% n0 Z3 @; U$ _$ v' k  -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
; c" N2 u& Z: \# A3 t1 b" X  M* b   ( B1 b: s- w5 ~, c7 ~' E5 c& N
  不停的ping地方主机,直到你按下Control-C。
  n+ ?# b! R& g3 u) C" I# n2 G0 F" r  
/ @: ~4 q9 F* w3 Y5 Y; l7 V- q' j( E5 K7 M$ \  此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
# o+ y' L- L# B, H1 F0 u4 S9 z  
" c8 E1 ^9 n0 B! v: B1 M  -a Resolve addresses to hostnames.
2 N5 p, G. g8 ]) e) [- H- I. w( ^  
) t0 H+ B+ z" G5 ?- V  解析计算机NetBios名。
- F* V' \, z, \$ I  G1 Y  
5 C! {& I$ @# o) J  示例:C:\>ping -a 192.168.1.21
- v: f* t' k9 B% T0 Z  
! g" ]" `7 w3 i  Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
. i1 o# m; D2 D' l# Q7 w1 c, i  
5 B- f1 E2 T, H, _3 @: C! j3 L! N  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 d/ B) l$ @% L/ P8 s) N% D
  
1 O: S  M5 Q9 k  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 0 O+ w& D$ `. Y7 q6 K
   - w+ L+ y+ E% S  ~9 X9 K
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . {# b& c* f9 Z& V2 x( a0 C
) J  {  d6 }0 o& M3 `
   5 c! I1 F; s6 @) Q# j+ S' P0 y
  Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 ?+ |8 m# Q( x# C
   # j5 p* E& j1 B9 N5 l
  Ping statistics for 192.168.1.21:
3 T3 l; B3 _" f) J, Q6 u3 B& p   ) z% ^% Z# M" N4 r  x% B
  Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 O" P; p& C8 q" B3 i( h  
( W# v3 n$ B! a# P  Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 M' a0 h1 w8 m6 s& {
   ; ?' U: k+ t9 B4 j+ M- }; V- U- B$ B
  从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- ~9 m$ q7 B  u# W8 S/ x   + l3 `2 J3 d. I- P0 ]
  -n count Number of echo requests to send. 7 V- _: r2 j3 X$ w) ?% o  I( M( e
  
0 W$ P, w" R3 j$ e: w/ x/ [1 Z8 s  发送count指定的Echo数据包数。 3 y! i, M, t% ?5 T5 _
   - j* P* P' ]& f" ?; \8 W
  在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 4 i* X) o, Q9 M
  
  N7 e; M' h0 e; _$ o: J9 N2 V  s5 }5 M  C:\>ping -n 50 202.103.96.68
' D* M/ m- ]+ F' N   8 P0 E- I* j# g3 F! W) E; h: F) B- P
  Pinging 202.103.96.68 with 32 bytes of data: 6 g% j6 c# O! i5 D0 g2 O
   & N9 k! s3 c( G+ a, D
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 m- d: c- M. G$ o   3 ?! ^* u# k6 m/ J3 ]# f
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 |: G+ {5 T2 ?  E
   . f4 B6 ^9 N7 \" x) a# z+ P) n
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - f+ s4 Q0 x3 g
  
$ ?# u  T: ~2 a2 V3 S9 u# }" ?* `% h  Request timed out.
+ A6 A  a( _4 y: m  
- z$ }1 Q( g! W" o8 a  ……………… ( O( B5 W- F! c5 p6 ]* b# h
   6 y" i$ L+ u: j, J
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; n- k7 m, Y" v, p
   ' B- K3 q+ s& b0 B; B( R& g7 L
  Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 B7 c9 t- F. V" T( v, Y# j
   7 l2 F3 _0 E. B( ^* i8 W/ ]
  Ping statistics for 202.103.96.68: 3 C4 {! p0 u( D8 |* D+ n' n; T  @
   ) w) d+ ?( j. M1 a4 U7 \  `
  Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: * b. [6 ^) m# J0 F) |8 ]) B
   : i4 n# ~( J- j/ ]: \
  Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 m1 P& I8 c# `8 }
  
( j; c9 V% N; E$ ^* A  从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
% l8 ^8 q2 [# j* Y% u+ M* {, A3 f  
6 Q8 s1 ]( `* ~, C: B  -l size Send buffer size.
  b+ Q# L4 {0 b3 {. d1 o  
4 `& ~" W, d, [. M6 q  定义echo数据包大小。
89w.org捌玖网络

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

TOP

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