|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 : Y7 ]0 U* x1 C: E
$ w) b1 x% R- Q- n: l% {! v
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 2 _: l# q r/ I. f2 z9 Q" ?
" ^$ P5 o) O G) y2 Y5 A# O7 D8 L! w
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 4 ]- d' P6 P6 E2 C o' c) b+ x
j$ D( {0 h7 Y/ | Options: 9 h& b' v2 _" E
5 t- Z% d/ j1 j1 u* t5 @1 y( J1 H -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. & g8 p7 Z/ d7 `' @
- @! z( q% `: `2 d$ r
不停的ping地方主机,直到你按下Control-C。 ' a b' W3 C/ E1 y# U
3 s6 e3 h& H0 A5 z& Q 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
- v G8 x' u8 @) A+ Q
. A: b! n3 K/ Y+ m* I9 W3 U -a Resolve addresses to hostnames. 7 v' m! H0 [7 t6 i+ b
$ G8 O& q6 Z2 n2 _/ z' W: P
解析计算机NetBios名。 - O+ V T$ O8 J& U
3 H) G; i9 X6 A9 H7 x
示例:C:\>ping -a 192.168.1.21 5 E$ E# B O5 w9 p! l9 e6 R
% b: F5 s- ]" F/ F3 Q Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
& I; _5 H$ I h( P
1 X; g- \4 h2 u* c; K; p' O& T `2 d5 h* c Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
$ E. c* Z# i* b( i+ K9 r. B
& ~+ l& s' m' r, a4 P% f Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 { }* M9 G2 ^3 E7 C# D2 T3 S
5 F5 S7 I+ x+ B3 L9 N; R4 I4 X8 h Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * S2 y3 N8 g" A( A
/ ?/ A o/ v, [% w: Z
! b1 w: F! Y* ^* b K
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 m# ]/ ]* C( e% c
/ g4 h. V7 b+ `( `4 y J
Ping statistics for 192.168.1.21: 6 _' m1 _/ z1 ~. o/ k8 |. {2 E
6 l. F" g {% y! Z, m Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 5 l1 v/ Q$ f4 `
- I: b( @' d9 T+ S Minimum = 0ms, Maximum = 0ms, Average = 0ms 2 _* ^ j7 z8 w% b
/ y4 i1 A2 d# }4 I: P. L 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 L5 Z5 Z, f$ i% s- }/ I
+ w! [1 Q; [! Y W% Q. I$ {5 Q -n count Number of echo requests to send.
& ^1 l# \% E3 R ' r3 p+ ~9 H% d: |
发送count指定的Echo数据包数。
3 o7 v2 q8 L8 M5 N5 w6 I- h0 r
# y3 s" n+ t, r( ]- n 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; r) M& `# C x3 A* K
$ h" I$ X8 `+ \
C:\>ping -n 50 202.103.96.68
* e' o5 m# Y4 A- V4 p( t) j
; }- W! Y' k; a+ j Pinging 202.103.96.68 with 32 bytes of data:
# J7 Y6 z; n+ x; \0 y & Z+ x3 Z* L( i$ P! a* C" n0 P
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
- M# v+ L' _% x
! T& P: W k0 P g4 N% x, w Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 N0 m4 m# X9 n 2 z& |; ^, g" Y. h9 M
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 ]* j& s# ~( w! V6 M; B
. H, c/ B% r2 z( _# Z Request timed out.
. D1 v% I$ p( m) V: {( R7 i 7 _! w) w# @* E' d" I7 j& Q
……………… $ v6 Y! W7 Y; o+ k) D
. O3 v; i/ A3 k. y1 M: I+ A Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 H& t/ O {; I( j9 e6 W
/ K9 M! Z) @$ |* V; @1 Z( R' N Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 v' C: l5 J. a
! E0 P; I+ R* I' S6 ` Ping statistics for 202.103.96.68: 6 ^# A; }& h. `/ x
3 @9 w+ @6 ~' n: v) C: o) ^ Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
6 E9 H/ H S7 ?; x Z$ V7 W 2 r* W! e& ]* o" H3 f( X" L+ l s
Minimum = 40ms, Maximum = 51ms, Average = 46ms
/ |% E' V" H$ _- ^- l7 Q% W7 P 3 e# [& G; a6 q3 d# z
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 - f/ A* `8 U& Z0 Q2 _
$ H/ X: M5 y+ x7 _4 n8 D
-l size Send buffer size.
+ t% U; e2 {' [" S
2 {5 N6 w; }/ |3 O) C 定义echo数据包大小。 |
|