  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
0 X+ `1 b2 Y+ |. i8 Z
7 C6 q$ e$ `3 R S/ o 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: : ]% ~: k5 ]4 X/ e, w
2 E7 Z/ o2 Q7 Q8 K: `
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 1 [; C7 h7 j5 a' R
$ ?( W# N& z/ ~ Options:
) {) S& f4 X0 e9 X 3 U' X* Q+ i+ L+ q H4 V
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . @3 I) c2 A! k# K) A
% g4 H6 Q8 N5 d9 d1 o$ g2 r 不停的ping地方主机,直到你按下Control-C。
/ y9 p7 i- w7 v9 t Y8 g
) ~7 ^( M7 f' A 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 . w" B' G/ k) X7 q/ @; Z( C
- t& `% D9 F' P& O$ Q$ F -a Resolve addresses to hostnames.
& f* k- o$ i1 A* x
9 k8 J; u- U4 |$ H, g 解析计算机NetBios名。
* M! }+ E- ^" L. _, O3 J1 ^9 F
! s1 D) @ g! o8 O9 Y& X9 k$ c 示例:C:\>ping -a 192.168.1.21 ' g7 g5 O2 e$ o7 M) D9 ^
! u- Y5 y/ `2 s% J: C% f8 P) {
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : B; `3 }! d) q. K/ c9 S
: Q- `( s9 V2 ^: @
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 C5 [( f- Y: R% b& A& g
+ u) Z2 D8 }: b8 { Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& T$ @- u" w; s2 \' [- m% H9 i) |; l
% w, M" A9 V" V5 m* A! N0 Y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! P8 u) k' [1 K0 Z s# A. M' e/ w ^- w0 N: L: h8 ]
# ^1 U( e, G8 P, h% v
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 o' r: r1 P+ U! u9 b0 A* s ! r( Y, J$ w# I- Z+ e) O
Ping statistics for 192.168.1.21: + Z* e8 F2 q2 y: M9 `7 F) X
% A4 h; J+ d: H4 h) |! |
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ( F; X7 p/ k4 h/ ~
4 x( d/ d( ^# w2 v; I
Minimum = 0ms, Maximum = 0ms, Average = 0ms ; C. B' ^7 y2 @$ j d
8 p; J& x3 z6 T1 p5 k; o$ W! j 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
9 X2 T" u5 @# L7 X
' J2 i% O# H# p! k# E( j -n count Number of echo requests to send. 4 X/ t3 U# q8 f( f* N
W* X+ V. a5 }7 p 发送count指定的Echo数据包数。 / E6 Z' g, S+ G0 s* k
* c% a J2 ~9 H7 J. i 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
, ^2 d' O# [# g' s# v; G3 U6 W7 R8 a 5 X1 b6 i1 B9 n" @
C:\>ping -n 50 202.103.96.68
" c; ^! Q9 T% c 7 e) |( F* t8 \7 x; k) t A) J
Pinging 202.103.96.68 with 32 bytes of data: 6 \( x2 A/ q0 \( ]" q: k1 T
0 T' G4 q: y# g" e1 Z" T Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 ~" ?; d( G2 n- m# d& c
O3 P0 c7 |: T9 M( S: b7 x Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
H2 p! c/ |- ~% R- L7 X( G* O , G: x1 I, n: a8 d
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ! N( \, K6 \3 r8 S! a& a% V
& K7 j7 z! Q: Y* \4 T
Request timed out.
4 W% R" ~& ~2 Y$ v9 m4 U 0 }1 D5 ~7 R% P2 y! h
………………
# s$ W; c% X' L3 q4 Q7 R6 Z 0 y5 Z% D2 V1 \0 \8 \: e
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * ]5 |# h) C R; n0 e
3 U9 G1 u) b2 r# o& j+ Y2 k: Y9 n X
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * g5 h1 l! \& X6 l
7 i# n: B0 G: Z+ K% x* U: `2 {! ?
Ping statistics for 202.103.96.68:
9 A/ E( ~& Q' Z e- }4 q3 v4 i 6 u: {2 i- e( Q
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 0 [( f6 h: z9 e+ z1 X' ~# M
' `4 R; ~' ~) _: J1 E u Minimum = 40ms, Maximum = 51ms, Average = 46ms
: Z# Y1 J4 S* g, l v9 n
! f" Y3 v9 k# H( \# b/ u- m; x& C# o( U 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 8 t" D- ^% F* {, h5 {4 l& p
" G, b: |" R/ E6 a, g -l size Send buffer size. - P$ l6 o [1 P5 w
+ r" B( }, a* L7 c
定义echo数据包大小。 |
|