|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 : p r E6 i( }. n. y! }+ i# u( j
8 u; e6 J# P) G1 n
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 0 ]# d. T8 Y# P& X4 Q5 F
8 e# i+ {" C1 z, _
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
/ U0 x# c7 w9 T8 [& [8 h9 l * x( |) S' g! x
Options:
( E, a% [- ~; f5 q' S& k/ W 2 C; ?6 U2 P1 s. b k# q
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
* N+ H6 U/ g. G/ C; Z3 J: z% s: ? 1 ]' w; q) T2 h# @- ]
不停的ping地方主机,直到你按下Control-C。 - z& @4 N, s! P7 O- [
1 B' Z- o& ]: y7 J 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 % g( D& `9 j; ~: K* s! [6 q! }; `
1 i# P5 a2 ?' U# f' t- I
-a Resolve addresses to hostnames. ( L! Z: I1 y) u. ~
) A6 F- K" V. ?/ s 解析计算机NetBios名。 ' ~7 Z& Z f: x+ I0 {: c7 R
o/ z h& F* L! @. n
示例:C:\>ping -a 192.168.1.21
+ W& |1 r3 f- N# B3 l' h
7 U$ y& z+ V+ s8 x& Q0 U$ p Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 4 b0 m/ Z c2 i/ |) ]% [0 y
( G- Q N0 ]( D/ o6 B1 r9 c6 @
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 |7 j7 P+ }4 Q' A
; D- u. w9 q9 b, P/ ]( ?3 @ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 Z" w2 C0 l j/ C: L. D
. [6 @2 e3 S, }- F Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - k# K$ ?: B# O9 s; E! \
* F6 P, ?6 K% e
& ^3 _- s: }( `8 G Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, B3 C* D1 N6 p3 V7 F, t& _" L
+ M) K8 ^. P1 G6 l5 V$ a Ping statistics for 192.168.1.21: 8 T3 N8 o( P/ C& d( ` K
4 _$ Y7 U" b4 x# p6 }+ x& \7 r Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: : F4 [6 d! I7 h' N: Q7 i7 [
v: P! [" F b; ~& h, l+ s
Minimum = 0ms, Maximum = 0ms, Average = 0ms , w+ z) L$ T# e0 a5 ]
$ j* i/ g, l/ L 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
9 P: J: d/ k! F% @/ h: f( ~
* y* a4 H/ {( Z* I' R -n count Number of echo requests to send.
2 M1 ~! w/ B5 W) _1 o/ m- f$ L 8 x8 e# U4 Q9 F
发送count指定的Echo数据包数。 ! {" D7 x$ E9 U L0 X
7 f& h' M% b+ I5 w* E& T8 m 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
$ t8 L- t9 N$ }6 Q 7 P7 Q& }6 |$ a; e$ B7 Z
C:\>ping -n 50 202.103.96.68
: C; K8 q3 v9 G) @8 e, L6 y
* l- o1 K3 c4 I* q. W Pinging 202.103.96.68 with 32 bytes of data: # K% B D1 J& o0 G" s/ F2 k
( V. h6 p9 u9 X7 r& g2 `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% ?- G6 m& `, M2 Z3 W 4 b# c* ?2 y$ P1 B& X8 ~1 \) G1 f+ p
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ E; d( d2 j u7 l/ w8 J6 C# K0 E
; E7 t: g4 i9 b) d Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( ~/ z# \7 G! v3 Y
+ \+ V- Q$ R* S0 L3 ^ Request timed out.
! w) v% |- E$ Y$ s. S K 5 |( G: K# N8 A9 K5 H
……………… % K1 c" J5 V! c% z) v0 }4 B: |# `
) |0 {8 D$ j6 J; q: |. l
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 E: |, s! ]# m- s : [, Q+ b/ k" C" m
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 e6 B3 I- a: J) S4 \+ A
% A- I. i4 }" H
Ping statistics for 202.103.96.68: 2 Y2 s3 ^; W2 t5 k0 D/ [% T7 Z. G& o
& c) `2 ]0 N* z1 b
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
( W! f4 M% |0 C8 @) k4 \+ N - l3 l- _0 h+ t) W7 G
Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 `8 d$ k: [% C
4 K% T1 B* K! c$ D. O/ n3 v 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- w7 Q/ T& X! n% ?* c
) ?% O; T2 f2 ]4 _0 ~0 e -l size Send buffer size.
& U1 K. J. f M8 T' L9 z8 L + n% o+ R* Q& c, K+ T+ F* e
定义echo数据包大小。 |
|