|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
I% J% I) P- Z
) {* b1 {2 p( ]5 o; M 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
' O# ~# K0 Y3 q& n! c 1 n& N' N5 P( D _! E5 X
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
& G5 B+ {+ [/ t4 H. X " r( m( U2 `+ _% k
Options:
2 T( E2 c: x7 \% c
. L; s6 u4 C6 ^5 C# \. J: A -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
' O8 z4 y+ n! r, Z" Z9 |
3 ~ S- u! u$ e7 m/ G 不停的ping地方主机,直到你按下Control-C。 ; P, j9 V9 `+ x9 @; s
. K1 t- r1 i& x7 @ 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
2 V3 f; b2 h2 {4 U # l8 E0 a" ]4 q {/ g
-a Resolve addresses to hostnames. ; |" ^# B6 W& A p
h+ M9 \% z, q# E# V
解析计算机NetBios名。
3 Z5 h. m) @% v# Z
; s* J, ?) E$ D: _4 X$ o! k1 F# Z 示例:C:\>ping -a 192.168.1.21 3 @# w5 F8 z9 j, w! _5 |6 }4 T% V
: K& f" J4 { d2 g
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: " W6 b' A1 @! E; b: R# i
0 p: r+ s" F6 k6 I6 O j
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ e4 \6 j+ n% H) Q
" `( d8 C/ n6 \; M8 P$ F Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 } c" b6 L. w3 V2 ~% ^8 m/ k ; G. L9 x: i/ u C, n
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
, r4 g/ z& _* d: K
4 Z9 o- ~+ v9 U2 v" [- X0 K9 @5 T + F @8 b) z# ~1 M+ @4 |
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 Y( U+ n8 W+ d1 S
5 J7 d" G O _ v, Z Ping statistics for 192.168.1.21:
& ^3 A+ [7 ^& W2 N1 [ {8 S / d& V+ u5 `4 ^# x* `* F
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
! z; j9 n. {/ O9 U0 ?8 C 0 D7 w8 I0 ]( s1 S
Minimum = 0ms, Maximum = 0ms, Average = 0ms
: G: g3 h& B% I' r0 S
( |" T9 g- a& \/ M% r6 Y) V 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 3 E3 m6 N) R4 U) L. j
$ G) ]8 b& D# B; v, b -n count Number of echo requests to send.
$ B7 r/ H- y$ A7 R0 r5 e5 F( [$ ` Y : P( r; _& m7 y( p/ J4 c: ~2 p
发送count指定的Echo数据包数。 , u5 K" ^6 E+ Y' @0 `/ r" w
) K% m( L+ D8 U 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: , i* k& H/ B$ ^& z) k& t
1 `$ _7 i0 V' c" Z! i
C:\>ping -n 50 202.103.96.68
4 H) u/ E; w1 C4 d' o# |; k
! M$ T) q& K+ C Pinging 202.103.96.68 with 32 bytes of data: ; A$ d i% d( s
- ] f! L9 s2 _% O' N0 r Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , M" v% t% F5 V/ _
! H+ c& u+ S/ \% q9 J' l5 p, e Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 # A5 T0 T+ p" X) P9 T2 s
/ ?; _0 R' [8 y( f* b% j5 R
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 o/ ^' [- \! S4 ]9 K
9 d) p& Q/ y5 |% b! R
Request timed out. " O3 @9 N9 t2 Q; x# M; W
& j* i0 `# ]. f/ G- \. _2 j
………………
# C! g+ j) ], }) h+ `+ n$ x
% o+ I2 G( r' p! D/ J) L' A Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 F+ d% W# `8 @$ X4 U
`- J) v/ S: X! z4 X$ X" X% S Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( ?4 J) [1 \0 ^9 b' a1 R
' D4 [, [. t' |; V+ L! b, A: r Ping statistics for 202.103.96.68:
' S/ ]1 {5 f" q; }) D 0 L; K3 J+ m4 N
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
. R: u% V0 T7 m , v3 t; X- \2 j* L' t! _
Minimum = 40ms, Maximum = 51ms, Average = 46ms
5 C; G7 O9 H M+ {2 n8 i% d# R
R; G0 M, `% w% Q- M. s! a) { 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
7 t0 N! L5 q) _, ] ) m# ^4 a+ v' y- }6 e0 B
-l size Send buffer size. 8 B( {3 G& p3 O: D* x
( K8 t) y" [# ?* {/ x& I
定义echo数据包大小。 |
|