|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
9 H1 L. l' k; \, y R9 h) y- P f; B5 @! U- B7 @
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 8 [: A9 w- _6 i9 r4 S# F& ^
6 x' K( e3 o4 @ 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
; j& V/ Q. Y' ?- E5 j$ p( A
. W/ M& d+ D2 L2 R* ] Options: 5 |; }( t0 l1 ]0 l
' D# l$ U6 X, c2 G: b1 g -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. , k H8 `+ y, R4 @' v4 q. V1 G
) C- n4 X# |5 j- a/ ]
不停的ping地方主机,直到你按下Control-C。 ; f1 K* [+ F1 {+ @
' s4 o% ^& ]: m/ t3 k
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 1 i2 W! s. V; B4 }. Z& B
6 [5 U( M" v [* z1 S -a Resolve addresses to hostnames. 8 e8 l9 r* l# x* R' R
Z) X1 U& g7 s8 j- u
解析计算机NetBios名。 + A0 }9 v: T9 C8 k G w
& ]3 _ ?' J. I3 f( }% w+ x- |# }( w 示例:C:\>ping -a 192.168.1.21
; r) n3 k) w. r8 G& ^" l9 ~; v
/ E9 ~% e- P8 \& W; A5 z6 A. V Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 9 H( u4 T( e7 b/ Q
' R0 N Q- J/ |( z% E3 L- ?
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. C8 y+ u3 P: w% a z 8 G. ]% a' @' }( b9 ?- ^
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! r! p1 ]# g: i$ X7 D' F & _8 }- I' A: `8 a z' h* ~
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 X6 @6 V, X6 f
7 R$ Y; D/ w! @& J* ~, V; t, F
/ n$ I% H; v' D Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
% W! g% q$ B( l8 p5 C9 `6 f1 U- c , L% _' z( B9 w2 O# ~! f
Ping statistics for 192.168.1.21: $ |; k$ n3 {. `8 P5 r) w
1 p3 E3 X* V) r. r1 r Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
+ x6 y6 d# ]) Q! n0 o# m! E3 ~ z* f
1 \2 e7 w# ]% n2 P Minimum = 0ms, Maximum = 0ms, Average = 0ms ' [# }9 U* A8 ?& A1 v1 a
. `: F; s% e, f 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 + P8 G2 K" {) N. J' v' h6 M
1 g; r) t& U* ?; t -n count Number of echo requests to send. 5 x3 f1 ^ [' g; n& H# P7 L
5 `6 B0 V% [: b e- q/ |$ i 发送count指定的Echo数据包数。
# m% r" g* l/ K2 F1 M f4 X! w" _ ! l8 X: k! F" l' p: _+ Y) w
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: . w& S2 G( c: d6 c
1 |2 ?7 h) [/ H8 i C:\>ping -n 50 202.103.96.68
2 Z! S/ q# x) ~. v' ?9 w I0 Y5 C 2 W2 v- a9 [! e7 ` m1 Y
Pinging 202.103.96.68 with 32 bytes of data: ! d- K3 I9 A4 |0 J* i. d {- q
' z# L+ i: u3 T7 [4 Q. `0 g, V7 L
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) X2 r2 C9 h, }) ^" m; U$ g& U6 t# R
( x- r3 Y( Q2 u) \& W: f Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 U/ n" \5 u4 z9 `
) H5 }3 ] `. [# o- s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " q J* r$ f- D3 J( X5 d( l( v
+ V' Q5 l3 S% u% ~; \; p# l
Request timed out. 3 q' t6 @$ m& w2 \3 R
* H. s2 M- U/ W4 p
……………… 8 s+ B% b5 J/ Z x" X
# S6 z# u6 J B1 @! N/ p
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 E" `3 x5 q( c0 H8 t$ o $ E! r" e" ^! j# t, |/ d" i! V6 F
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 E9 X/ g$ ^9 R# x) g1 M8 M
% |; r4 \" e: u# ~, E. f. G
Ping statistics for 202.103.96.68: 8 l# J1 d' ]5 \# j( \
* N6 w# w J1 p$ ?, A Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
" |2 C" i) I" w; W+ R7 B D- H7 v& K. H9 I; S0 F9 ~
Minimum = 40ms, Maximum = 51ms, Average = 46ms
4 @- `5 {' ?% p2 d
! e0 k0 P) m. q2 G6 Z. s* v 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
( |/ P* }* x1 _1 B! A: ]
+ z! F3 s3 [8 x( }! e, B& N/ U -l size Send buffer size. ) f1 D# P& G* R( ]
+ b$ z z6 d8 z' a, q2 k
定义echo数据包大小。 |
|