  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ; x7 a7 Q" I* j9 n, C2 E
/ h8 M* z' Y. B8 E* z
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , T, U5 w {+ T/ Y; j- F3 r# @( _
n& m3 i+ u) }
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
T$ e7 @6 f! A$ w+ J. Y: {3 L
( `) s4 ?# A2 Z1 b Q9 ~ Options:
4 [4 ^: b: _' g/ S1 v v% D
7 g+ z2 c. U4 L8 X& o! l -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ! S% f, U5 d) h( {
; t8 @9 F d; x1 u: U 不停的ping地方主机,直到你按下Control-C。
% L% \5 ]$ A9 U3 D J
2 z5 C' N1 ~4 c 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ( C( J& I) u4 u
4 l% {+ w$ d2 h/ `. G -a Resolve addresses to hostnames. + l- n+ p7 Z. q: h9 B. e# h
, A! F2 Z& X Q 解析计算机NetBios名。 $ J4 K( C! m% r7 F* M- n" C
$ Z% z% F$ W/ E" r 示例:C:\>ping -a 192.168.1.21 3 r9 ?: Q1 g$ F; `' f6 ?6 M& W
" C9 i8 ^' W2 G3 d Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 r0 c0 X1 M1 h/ \7 v8 t$ a$ c; q
3 F' n/ ?% f$ B Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - P% ~. F* M4 a4 u1 r" v: B
2 o, u" y% O3 J8 k3 X Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 I y' h7 c% m0 o0 Z3 g7 W& y2 ~
$ J* d+ J9 n8 i8 e8 \! R! x
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ S* i% e9 x3 s, x& F, g# B V
; x- h) }/ x% n* X- I- w e
- r% n! |* V: C1 p h Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: l& b. W8 s* Z E6 }
, L; O* O, d% z% e+ T0 Y1 } Ping statistics for 192.168.1.21:
- f0 f( U; G# C- K' q2 r, i ; ^5 l1 c$ L" Q# ?+ I) A7 I. L
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: " o& v% w4 `) Y
# ~8 s& o; l* Z: x$ F) P Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 h$ f j7 _* t+ J0 a; W- j! _ # q5 _5 o. _ x3 C* ^7 ?) ]( K
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ( v% h( o& C+ |# u* s9 O
$ ?" J# [ l4 E! O. f
-n count Number of echo requests to send. 9 y; W1 j4 f0 v1 ~$ |# k
3 Q3 ^5 y$ b: E$ L3 f+ G- b 发送count指定的Echo数据包数。 8 a; x% c, }' U
1 X7 `/ V8 ]9 R- x5 [8 Q) M
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
) l! M3 F( E9 Z, D& m
' s# f* [* ]. O6 l7 b- g9 N C:\>ping -n 50 202.103.96.68
. v& T4 q* H4 N" M
8 j. M1 ?" Q9 A3 n$ u4 r. r Pinging 202.103.96.68 with 32 bytes of data: 7 Q) o+ L/ N4 S4 |
5 x, i0 }5 ~3 b Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 A$ S, S3 M7 w
3 O4 v8 y& X4 R+ ` i! M Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * Z( k: ^% r J$ W- V2 w# R( m9 {
& S: E& C. \2 u* M; I$ W
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, ^3 N) E; V! H- {! e Y8 D$ E+ P7 C( b3 Y) `& F7 }0 F
Request timed out. 0 D& U5 c" k5 d# O1 D' Y0 B% H
# ` n7 [% a) A0 F# D/ u. t; h# d z- t ……………… 2 y$ I( I" j# k) X
! o- @ t8 N8 ?( Y: G Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, L: ]; J1 o8 e. f $ c V; ^9 q3 g; }+ `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
) r1 l; ]3 n- n, C- V) W2 Q9 } 6 j9 o8 B' X4 q$ L
Ping statistics for 202.103.96.68:
' Y1 V; B. L- j/ ~# M X2 ? $ K) x# |5 C1 m) ^1 l1 P7 n
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
( t- J" C% R/ L+ p
0 Y& {/ ^3 L5 E( w5 p' C- j: L. K Minimum = 40ms, Maximum = 51ms, Average = 46ms : y8 r( f9 i7 x. i, i8 G
+ z. M4 H5 A3 D5 f+ n 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
/ F& N+ z4 G3 V7 h" z& T ! `% A* M- C* l, }) m0 p
-l size Send buffer size.
+ V/ ~3 t% g; P! G: S; }! u
$ `7 z/ i6 _6 j1 K4 q8 ?! B) q 定义echo数据包大小。 |
|