|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
% @+ ?+ @( P X9 V
( Z/ }$ [3 c. n0 g 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: & \) ]& O4 ]* ?3 k. }. L
, ]) j& `* h( e( @& b- J, N
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 * |) ~8 Y5 ^* T% M) a/ Y8 r
- R0 c' L8 Q# h/ ` Options:
8 j( {9 P" k$ k- x# v
4 n, T- _' P- {. j$ W% t: M& C -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! n( B% A2 P1 b- _: }: S
* J, t2 A" Z& T; a& P! N3 c1 F
不停的ping地方主机,直到你按下Control-C。
+ ]/ o. N4 E& z4 H
; c6 A. m9 ^% L X2 H$ q 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( ~1 k8 D* U, j, ~5 s8 j9 Y+ ?
" O2 X* c& F. J( B) [6 `. g -a Resolve addresses to hostnames.
' d n1 _. c+ x' r % K, J# Y$ ?& |* P1 m- w9 |
解析计算机NetBios名。
6 X/ `) ]7 K7 t8 [: g4 d# w
% y _* Y' W6 r. M 示例:C:\>ping -a 192.168.1.21 7 L" q# ?$ x! r$ V$ x
. a: P0 d+ h$ z. l- v Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
2 O6 b7 m v2 ?6 p
2 B! p Z; U+ r: \, _6 f1 o Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 , f' E- }4 d. O6 m J, @2 |
: [" w& @1 F! @5 y& y9 b E Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- {: `6 p5 E0 _! _+ Q; D2 [ & ?3 f, n/ K! e- G
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % r; D' } c- T/ t1 G
9 D$ Y: N5 d: ~- U1 g
$ M; p4 t8 h7 j, V' w# [
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 Y7 f* f/ k: x
& ]! v8 M) q' p* I
Ping statistics for 192.168.1.21: 2 ?$ ?/ {2 d3 z; p1 J" S
0 H1 w* _- s b% O2 f W Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 1 {' G1 B6 D5 G0 h( P
6 |- x1 ]" U6 v# x1 }/ L
Minimum = 0ms, Maximum = 0ms, Average = 0ms
: `: O( R: H* h4 {* j! T5 o& j
4 J3 t. h$ G$ }2 C 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
' ?& T) U' P6 D9 N' z/ H/ F , c I( I) Y. c$ z/ m4 _7 c ~
-n count Number of echo requests to send. , z7 T8 I: E9 m
8 J2 I; |- |" S+ R) I R$ G l! M
发送count指定的Echo数据包数。 7 o: L7 s8 B7 j6 C* @2 C O% k
! E% n3 V y7 u9 I! R& B
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
`$ ]& w& ^& h7 D" h$ F . V* T u. ^0 ~# _9 M
C:\>ping -n 50 202.103.96.68 - h3 ?' Z/ C+ _& N* \: Z/ c6 Y
5 S/ ~8 R4 E6 b! d9 I% A Pinging 202.103.96.68 with 32 bytes of data:
( ]" g, h' _( B' m, F* `1 f$ S ! E6 `) e/ w0 s; | ^
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . E6 R3 T x/ C. x: J% {6 o1 r
; {) X6 B0 I; N
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 C- r$ D' f, I. z) E
. M1 h) N8 I: W6 y; t; x8 ` Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 {/ _& t: e5 W" _ b 8 V$ Q7 y3 F4 ?" `7 k* |% X$ q
Request timed out. 7 c) A- @) y1 `) m# e8 W
8 D# U4 M) W) e3 R8 r x* @ ]
……………… + Q4 ? x8 J3 T
; _* |) r$ |' s0 d" J Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 D# x* w) G) g 9 j: C: W5 U& c! r5 P) L
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ P: Y" W0 V" u
( [1 }) @( \6 T/ S ~( n; e: y Ping statistics for 202.103.96.68: : ]7 t8 t& m* l4 W
# N7 q! x/ m2 i* z2 P! V
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
[1 o H8 d! O9 S0 O# d G5 I 7 |9 F5 K; y; q# \, ]
Minimum = 40ms, Maximum = 51ms, Average = 46ms
) p u# d& } l6 _
+ _0 p4 D9 S3 g- v+ { 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
2 G# p3 m: b K. i' o& ^0 g0 M2 [ ( O/ h0 o! Z+ F) O4 c+ m1 R
-l size Send buffer size.
; ~$ G. c9 U4 j+ s2 X s & m& R3 _& d8 X9 I7 \0 u, b
定义echo数据包大小。 |
|