  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
2 O o3 g4 N E5 h
, `6 K, W1 E: g3 _ U* M 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: . C$ Q6 D7 T3 D5 B- `
0 { P0 l; V1 m4 }, ^4 D5 C
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 1 d! R' T2 L; R& T) I- N0 ]3 h
2 X4 G4 l8 G$ ^. O! L- A" N
Options: ' i! L& E8 o& |7 k
* D* W* F! j; x9 p4 P3 n -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - c5 N4 E V/ C( n
0 a% w& c$ l+ H3 A3 Q/ y 不停的ping地方主机,直到你按下Control-C。 ' c$ B" f/ }% e/ U. l% ~1 ?
8 k/ t( |: k; z% F 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " t' R* R8 _/ d7 Q' O
) e0 E8 S1 r+ k) w' L G2 q, p V
-a Resolve addresses to hostnames.
) ^; h. H. a, F1 ~9 P+ V* V1 q: y# O 6 f/ H' t7 X6 O; o# K; n
解析计算机NetBios名。 2 O! G' }7 Z8 c7 _+ @
7 y3 c8 q' q. `" ^& A* r. s+ X
示例:C:\>ping -a 192.168.1.21
! k7 u% \; ?) Z' o7 Z & R5 ~& A# I, X, a$ C1 E; z
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 3 h4 J7 c( e" x7 ]/ ~$ m
9 ?8 o2 x8 W0 m5 h$ k1 m
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # N6 @0 M$ V" E( _) V
5 g: d! c5 p5 h- Q: a3 W, K
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
# A+ B0 P$ Y7 O: r4 P
7 [$ H* G. r$ I/ x Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 G1 |8 ~1 e, S# I) z# y5 ]
1 w+ T6 Z$ [- u/ d
4 c+ m- a7 }3 p) u; P Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. l% h3 t9 a2 l
4 x9 }/ \7 B# ]8 z* ^0 l: k7 X Ping statistics for 192.168.1.21: 4 i+ h- {$ i; p4 S" H, r3 b. q; O
2 A" e5 i9 ?+ ~2 U- } Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: * Z$ ~% j' O4 @& i- d% u
1 t% A Z: U4 S1 \
Minimum = 0ms, Maximum = 0ms, Average = 0ms 4 l) G; U K) I# q. s
) ?0 Y) [# Z, B/ K
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
, ]4 u, r% I+ I" e & j, R6 w. e# U& b+ L
-n count Number of echo requests to send. " x/ l- v7 y) B% m' i3 l+ M& I
. K7 j) ?$ d; Z1 k; z5 q; K 发送count指定的Echo数据包数。
& X; N, w. w* t: p) ]; G D
, k* F" K' N5 l 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
$ m3 {$ C' D& L9 T3 z% Q5 A6 }1 _
! i- y# _ K6 J5 Q. ? C:\>ping -n 50 202.103.96.68 v a- O$ S* J2 a* r- D* _
& j! ~6 c2 m/ k/ R4 i4 a: d! e Pinging 202.103.96.68 with 32 bytes of data: % G* e: K9 c# ^2 }/ e9 u+ s3 ~
. v& W* y) m+ d7 v
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # s' }9 G& W, h1 M& R& [
, g5 {4 G; m% o0 J4 {; [7 R- } Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 R, D. H5 Y, S# O2 @
) |; h1 g8 |$ p6 ~9 N7 [( V( j Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! K5 ^- T3 M. t
0 ]6 k: _# k- Z7 U3 u Request timed out.
7 v( P) R/ n( z9 i9 n & k b/ f8 O0 _1 W- r$ X
……………… $ K Y, n7 g) j# ?
: K1 g4 i& F& y) X9 c
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& h+ X& N1 M6 W& I# i
9 [+ z. N- W% Q/ `* B Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- W. O% q! x) I $ R2 d/ ~4 g; o2 m2 ?) Q5 r- _9 t
Ping statistics for 202.103.96.68: 8 Y q, @5 ~: w2 b% |3 u B v
3 N3 n4 M' n1 C \7 D) S- a9 h, n Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
: ?( N4 U1 ~ P: ^5 y 6 e, ~& u% C3 ]4 B
Minimum = 40ms, Maximum = 51ms, Average = 46ms
2 q* e% h/ G" O- ]; V# s) c* h8 U
- y, l; V/ V! l8 G* X7 z0 r- Q 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 + }% h, q5 S0 l& R S% i& R
3 \- i3 _; a& u; ? -l size Send buffer size. % O, O7 V' v/ C: u0 q
7 e; x% w) ?, K( y0 \ 定义echo数据包大小。 |
|