|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ! l3 g- _8 o" I# F% i- P
- S, R1 n7 |( ~& G0 i) T 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ' a9 \' V% B1 q8 s8 D; ~
' T. d4 f! @3 j0 L
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 - }! ]+ E$ ?7 A- E. ~
9 e+ b1 i5 N! o- b* [% D. f Options:
u- R# S* E3 z, R # D: v! {( K E4 b
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
! M( K; A5 M6 i
3 r+ q: s/ i0 `1 z+ M 不停的ping地方主机,直到你按下Control-C。
9 ?6 a6 R+ j- V& P0 U + X& |! j( u5 Q# j' O5 b
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 : g ?& {! N0 M" \# H
& }9 c+ p' P. j# n9 ?0 f -a Resolve addresses to hostnames. % P) |+ J. y, H" n9 o* j
1 ?+ {' D3 H+ u/ l. Y 解析计算机NetBios名。
6 S5 ?9 N8 @/ q I& v9 Q ) @- g( Z% r" p; Y- B
示例:C:\>ping -a 192.168.1.21
0 a5 b! {3 ^' Y4 S% n
- a4 W, l7 w8 Q5 N* x' X9 t Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 4 v8 q# u3 q# F3 c/ z
0 n% \2 i. Z! R; Z, ^ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % i4 R) K4 A" K9 z, Y
% O% u" x( D1 @: F R Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
; i- E7 a& l- Z1 \/ |" a
3 R! M2 y! w" |% r0 O- V Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : V# w+ y% h; g* l
) @: _. V$ r% c4 \# q
) J6 d/ G) k7 K/ g4 S Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% I' k, O. n: g5 } ' n% h' \/ Z R0 ~% z4 s9 v# w/ I
Ping statistics for 192.168.1.21: ! k2 q* R, n! b0 U; {; W6 y* I6 ~
$ o. L& _/ A: L3 @9 X
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 9 f) }& i4 q5 D
0 M6 m( r0 p* K4 w
Minimum = 0ms, Maximum = 0ms, Average = 0ms ' `4 X6 T1 K$ T# o
9 W9 U$ |+ e4 n2 b7 Q j 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 M+ z0 V, K& p" @2 o
* S$ H( a* i5 S
-n count Number of echo requests to send. ; K& K; b2 s7 G3 ~. j+ { V
6 p/ a i% l) g# d! o; d 发送count指定的Echo数据包数。
- ?4 w' V' R* u# o3 M 6 J( Y3 z& v; \" r
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 4 u) ?$ P8 p* u4 I: g
: }) e2 J$ G% O$ n3 f C:\>ping -n 50 202.103.96.68 + o g" n& g, g; ]- T, U
/ [# ?" W; b: i7 k
Pinging 202.103.96.68 with 32 bytes of data:
1 E) D8 z6 q ^( G: V; q2 M
4 y1 }- [ z, x Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 v5 N( k+ V: a
2 F& {2 F7 T2 [4 ~0 S" a Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 _+ }) R1 J6 ^& N
( ]8 `. @' i: i4 H, A Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% k l# {6 P" G+ q
/ J9 ~( R8 E5 t0 w8 E+ h Request timed out. # |2 G5 [0 m) n+ q! T
% v4 x% R- z# r
………………
- p4 g9 X0 g+ r0 ?" L, ` . y2 M' Q+ B6 G2 _2 _
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( w& o# r q* v: Z( b - E) L5 w, G8 q; I# D$ C9 `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
' d5 \( h2 R( G, A
! T' Y* l% A8 G+ ]+ ?9 ]; { Ping statistics for 202.103.96.68:
- ?* ]2 X% `6 o3 L7 p + x: `' D; T; J) ?0 z' e" y
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ) \( ^0 ~( i% D0 K
7 f( U2 k: a6 c0 G
Minimum = 40ms, Maximum = 51ms, Average = 46ms
9 _$ @( ^0 o/ s5 ~$ ~2 B
' g* T+ h/ b$ ~% g( f3 w) s1 u 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 * j T& q5 [3 |2 W) }; k" Y
2 `/ b8 `9 g: Z7 w
-l size Send buffer size.
2 R& F' @* H/ W& c
# ?! l% A# s5 _% O: t 定义echo数据包大小。 |
|