|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 9 n" C- J2 a7 z+ K4 P) E
3 A% `/ [( {7 F: C, y' W7 x; X 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
7 C' g4 @" Z0 P y' t: p) G
3 T% |$ q3 o! R) P! k 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 - ?2 J; B7 o: x+ J- e
2 ~0 A% J' q" R: ~7 G1 ~7 j- v8 a
Options:
! x" n+ A2 m) u# M) j1 _1 L" P4 w 9 D; H. X/ s% f/ [7 J1 p% Y2 O3 Y8 j
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. + k& C* |2 X& O/ x1 Q3 J
! e/ v, E X& |0 C; e" d) S. |( l2 m. E
不停的ping地方主机,直到你按下Control-C。 ; [$ t3 z* `+ d8 k
+ I# l, `+ F. u2 t2 a7 K2 e- V: j
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " p5 ~- X! F" D, \
0 i& n M; f+ Q9 u8 X y. m# Q -a Resolve addresses to hostnames.
p/ O$ H- f" m) U; g
; v. q. q1 E" R 解析计算机NetBios名。
6 \- f+ A0 _2 E& z, z. M
1 o2 q3 J& U9 i8 \$ x& j, |. i% S' b 示例:C:\>ping -a 192.168.1.21 , u& ^. a+ V, Y. W
4 x2 D9 l1 k% S1 |& k
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( w4 w+ p, {$ S' y1 M
1 F6 h; O) `) B4 }, I Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! z) I B+ V& ~8 f5 w
$ x, U" I# z! r4 v Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / d5 ~1 y+ ?3 k% G, J, E) M3 w* t8 v
4 M' Y3 }; Y/ y; M$ N c/ g1 V' ]+ e
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 Q k: r8 a9 _1 u: T. S" `
) X8 ^6 c# U0 y# k! z/ q9 s1 h 2 j0 Z& z0 Y1 Q4 S" g$ _4 N# B3 x4 v
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- O5 n+ {' y( T, L6 B - B: H2 C! o3 P% C5 Y5 }
Ping statistics for 192.168.1.21:
+ s! }0 |6 A9 R9 H # e% A6 }) ], e( I
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: d) g0 B% T: s( D
# }( E5 M1 f# x5 [$ o" S
Minimum = 0ms, Maximum = 0ms, Average = 0ms 0 a% T: z! \ P
; b5 i& V! z6 b, c: n! G) j3 o% E 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
& Y% e- y1 |7 K0 l1 e3 t! i" ~
$ ]; ]9 V: }; ^ -n count Number of echo requests to send.
+ L" I% M2 @' U/ s+ o+ d/ x( ~: ^& t
. g7 Z! ~5 W/ s3 Y% V" e8 i9 { 发送count指定的Echo数据包数。 & s# |. y8 J4 \8 u
. U i1 A: K& \3 t1 z+ r 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: / [& f' H( z# S* V' a
3 T. G! x; [7 M; ~1 \# R! K C:\>ping -n 50 202.103.96.68 8 d+ |9 L {: S) B
; K3 V! g% S# J0 c% h Pinging 202.103.96.68 with 32 bytes of data: 3 Y1 g/ B& T9 D
u& `- s2 I3 H: }
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - c& ~$ }; `1 X% }
/ w! _1 _$ J& p Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: ]; r! e& _1 N$ y ' w$ m( o/ {" }- F7 [
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# m/ `: w( ~' o# g8 V- H0 b
C/ L5 H3 p3 R% G+ ]1 u$ @ Request timed out. . ]8 ?7 D) G# z" q; O
, ^( N# l- F# j" G ……………… 4 k& j2 v1 o/ q
" U% K" q: Z( F* _6 w
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" l0 U" r \ n2 f% f' M2 y$ g7 P ( d g) e- i7 R" z1 h1 D8 T* ~9 U9 s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! r+ X1 Q# i) Q0 t
9 E0 m' |7 \& n# I. E7 y
Ping statistics for 202.103.96.68: 2 d( i4 Y0 |+ Z `
! B* ]8 n$ I3 @" L, L7 h/ s Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 E- ^4 L# t" y5 O! v
, n7 W, F- B* C1 T6 H7 u
Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 K/ i: y, M4 O% S
1 t2 D( d( _" ] 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
, S5 P. Z6 ?: u0 N9 ]7 j 9 |& H/ _, z& |' v6 R* W9 S
-l size Send buffer size.
5 \& K# L! g' U" A+ R4 A ! V4 v. }! }1 n; h W8 C) H- P8 [
定义echo数据包大小。 |
|