|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
: n& z+ k! V. j
- m% O9 V* D5 M E% C 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / i# d6 |2 _' Z" H; Y
6 ?6 F8 D' @: o1 o
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 : V; f( n5 p4 D' o% U
2 N) G4 A* f- [% w
Options:
6 h( N( `+ d7 N8 Z" J/ g6 y! W9 ]
* F$ R+ ~7 H1 N -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . ]" R9 y' M# r. s7 [
+ R3 @+ P; a% C5 \/ C. _- c
不停的ping地方主机,直到你按下Control-C。
0 A" ?! L% }+ v8 [7 `# M) A3 l
' J6 d2 n* |" M9 i: O2 |9 @ 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
; g/ ], q+ `6 q9 S$ v r8 \- |7 Z [. s1 `" \+ P
-a Resolve addresses to hostnames.
9 m$ D' H1 g; F1 b
7 I" ?6 u! v* W' G 解析计算机NetBios名。
1 L% X4 a* |9 g S- d& N, B9 K 3 [( z. E/ a" W* i: }* n
示例:C:\>ping -a 192.168.1.21
9 {& f1 Z `+ B: a' d7 @7 }* _ {5 Y$ @0 Y; z3 _
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: $ Z8 \7 V- T. k+ h: T( @6 I
g/ K& c% b' p8 Z9 I: R- w" J9 E Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
/ \5 z4 c; f8 q# e1 b4 M' I" |) j) U 5 E8 |3 q6 H/ x+ O: Z$ W, p9 @9 [
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / c% N( k4 {$ X% S3 D( c: d" S1 }. Y5 L) E
, N$ M8 m$ a' w6 s; ^
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 m# H& z) v7 {( g+ ^
, |2 i3 z+ `% I9 j2 g5 R
/ R' C9 s* E: O! z8 [) V1 V! E
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 Z6 B1 Q. S1 `% x9 ^$ m w _4 y5 k$ F4 J" S
Ping statistics for 192.168.1.21:
- K; C( y" s& d' D * h) r+ Y* k8 `3 u! _
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 7 l- P6 e+ `9 B* W
; I2 @0 p* `, ]# ?) E \6 I
Minimum = 0ms, Maximum = 0ms, Average = 0ms
% s# Y& H6 x! G % B' n9 u( c! j
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
2 |0 s) G9 S, L8 J/ M# u1 u6 P, ~
" W! b2 X0 N# | -n count Number of echo requests to send. 2 O+ N& L$ x$ k: N8 a. |1 M5 I
' V- c# M* n3 S: k 发送count指定的Echo数据包数。
, o: W2 C3 {& X4 [/ X
9 b' ], l6 O: Q: Z 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 8 | J- W$ T F) j7 [3 m' m, m
+ G h$ }; S2 |& y4 v
C:\>ping -n 50 202.103.96.68 * X% @% n3 _* _) J7 t1 ^' @
, n; C+ O$ j' n% \
Pinging 202.103.96.68 with 32 bytes of data: , U0 v" S: U: X9 l* V: |7 \- o$ p
! h! V+ X H& f+ \$ b% n3 L' S- }& P Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 Y. Q+ z1 [' {8 J% r0 h# f; _& `6 W9 U1 Z
! |$ Q+ `0 R6 M7 e Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) f3 \7 V& x+ n' D6 Y
+ e* s) Y) Y8 J Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 O' O- E! O) C2 I: w- e
' {4 c7 k, O0 J0 W9 B7 o: a# {
Request timed out.
& i# u' l. \! L5 w 7 k; a3 C* a4 F
………………
/ ], t2 Z" ~( w/ t6 J % p# v9 l: P3 J, F
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
/ j+ G Z! |0 l* }. j( W
& R) y1 e. K) e/ B: [* U+ L Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: o3 {) d! F% Z. W; [# M7 k
: ]2 _" T" h* g Ping statistics for 202.103.96.68: ' R- P$ b# b, V9 V5 K8 j1 d
# K+ d! A' A/ w7 i j# }5 i$ f Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
t; D; o6 G! [ ! r2 U5 v3 G- C' t! T5 a" J) b
Minimum = 40ms, Maximum = 51ms, Average = 46ms ; g% Y( c; N0 U& g- W! d( Z( T3 {
6 U5 r3 B( L. x: V3 H) X 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ) V. a( I2 o( C8 y4 t0 B
3 b6 _- q! H4 q; a) I4 Y- ^
-l size Send buffer size. 8 _& G! @9 X5 y+ k. V
, O) x: h8 K) A7 A$ Q/ f
定义echo数据包大小。 |
|