|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 6 y8 H) s! t2 b M
+ T" r" O- {( Q* p. _ 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
8 V ~9 p( f2 n9 V6 }6 {5 ?( `
1 J8 C" |' q3 D 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 ) x& h$ t& B7 L7 d5 ^$ G
, Z7 v. m% M4 ]; s! @* J/ h: U
Options:
- p2 c: r! {+ C
; K. E' N: `3 j% i/ g% V0 H2 I -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! T ^+ u3 N \4 e; ` ?3 p4 @
, h. U% O. D2 Z 不停的ping地方主机,直到你按下Control-C。
/ S+ k+ e# v$ y5 [% B& d* D9 V+ R 5 c6 t i* E6 x5 `* j4 O8 k3 X: x
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
2 K3 N; c! p2 e5 J5 d# ~: l+ F
9 H2 h$ v4 V! S, |' c; t: d5 p -a Resolve addresses to hostnames. - e7 i: l# a7 h+ e
. ]8 l& M N2 [ @, d. f
解析计算机NetBios名。
3 D% W. c) G' q7 @1 V
$ `0 `: S/ G! _# R 示例:C:\>ping -a 192.168.1.21
: f7 S2 w3 t4 N; H+ j2 k/ N c5 `1 O. Z' |* c- E) H
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
) G- N; N: V+ Q( j6 u5 M+ j2 ^2 K - G* [, u' S- i# O
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 " i- \: Q- ]3 ^$ c
3 a, [8 G) T# t# ~4 F# S3 ? A
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . K8 @% K7 K5 X0 i; C' D$ Z0 O- M
) ?1 d: B& A" I+ G g) Q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' ~, U2 ?7 o- M Y# X3 V' ^- c1 R9 w+ ~; i& q& o
1 m! v2 L, T$ ]
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 \% L, r: P3 e [* {3 g
% D2 u) s# F9 L. ` m
Ping statistics for 192.168.1.21:
; d% D4 V% Y- N& Q* i8 W4 C4 o
# j' f+ i# f' T+ ]6 d# R" n6 s Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 9 I |1 g6 B0 F9 L) G5 g1 n3 y
0 k- o$ |* ~# B5 c' \7 a6 M" O) B
Minimum = 0ms, Maximum = 0ms, Average = 0ms
. ~" [) Q5 u- ]7 \. }' ?
L2 }8 N4 h9 O8 D" s( O 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 4 q9 ]0 G9 D2 s4 @
/ k# n9 y$ c/ }4 L
-n count Number of echo requests to send. 8 X( C) ^3 T8 `$ b% b b8 T2 o
1 O' i2 O/ ^- K( M2 z! a7 a! L
发送count指定的Echo数据包数。 7 C' w1 D1 j5 {& U
6 l: p. P6 y5 I+ ^8 e 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: & r6 K; ?3 n3 C& }9 N/ z
- J4 ]: F: M8 o3 F C:\>ping -n 50 202.103.96.68 / h, d/ ^2 A) R: ~1 g
% d3 I- F- L- O7 [ Pinging 202.103.96.68 with 32 bytes of data: ' z# P) }, q }# i/ A; i B
2 l4 o0 k( @& {5 ]
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 p5 q. d* y6 e+ M( N 5 U) d, A/ J5 i: V+ T
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 + T$ |. m6 P: }) \0 c
3 L7 V7 V$ @2 {6 m* m Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 H; o" ?* B; J N0 B) r: `
. |) l* W2 q6 @4 E5 h1 W; D" e. f5 @
Request timed out.
: W6 |; K5 x; n" g' U0 X3 x1 V+ Y% Y1 [ } 7 k1 B+ `; j$ U& s
………………
3 F5 H' h7 E) P3 s, e. `
; b' r+ X1 C' b0 o* o: Y+ i Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 $ @3 n4 c3 P( R5 o: @/ U
5 ^6 ?9 w4 ^4 Y+ Z! d1 J Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
f/ U1 O" {) _( N6 ]. M 6 o9 x3 R9 [8 g5 f$ `2 d, Q) T0 V
Ping statistics for 202.103.96.68: ; Z9 f; a1 ~6 y# d# V3 L
3 R2 I5 Q; O, B0 t, B; n. f" Y Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: , A$ x; @ V+ @
, h3 u" r0 [: P( \ Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 I9 @9 n6 e9 z& c1 g4 q
$ T1 s1 B. J g7 o. S
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
/ \) `/ @9 R' x2 O# h 1 b! P: r2 \8 s( n8 O
-l size Send buffer size.
5 y) z3 Y% A$ X& s
- X/ e8 ?; e! L+ q1 R- g0 z! @9 | 定义echo数据包大小。 |
|