  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ( b% X' g( E. z
4 |+ _$ x* t! X1 t. s1 E
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 4 n8 J8 w7 O. Q' d' s( v/ D
/ f& v/ ^5 A5 i. W7 w 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 4 B/ q9 _* c+ v7 O+ `: }! Z
+ d- M* O, ^0 ]7 ?
Options: : A4 ^ @# c0 c* e0 P( L) `
; s' z5 d5 s" l6 }4 y8 r1 F
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
* n8 M7 e, J( g- U' h
R3 }* q4 a. t' o% K7 J 不停的ping地方主机,直到你按下Control-C。
4 a5 G, `! K7 |; S8 A9 ^
7 r% ^, |: j: }# `2 Y+ [ 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 - i2 U' O F( I, s
) `4 j+ t" ], V: @# q -a Resolve addresses to hostnames.
5 l8 q- t8 k* L0 q5 x `& J: @* H
0 I7 ?1 ?8 \( r 解析计算机NetBios名。 3 H1 h2 s; W- t/ U+ S; S$ L d ~
8 t# w. }, f! ?* H" v# P. u u 示例:C:\>ping -a 192.168.1.21 5 n: X# Y# r" B4 X: a
5 o. n" @4 t N H. K6 h+ B. u
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 2 I- W' O3 Z _) U/ b
) I4 K* L" M! t' w
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
- `5 J& }& R# z3 p' L- f* { - V$ n k; n: V! R8 f; i
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
0 j [% n; t( g2 Z$ t+ X ' s0 T# z q1 V2 D
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - _& w: n7 ?- u. q7 x% V
6 L0 P4 {% \0 w; U0 P. V
% M7 O8 b9 ~+ p4 l) W Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + s0 Q X7 U# i3 n
P4 h5 O2 Q) `' d Ping statistics for 192.168.1.21:
. o: k% u; e' U# L X ! E; k, t$ Z) f3 L% k% @
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ! e+ C+ U1 Z; R% n9 u/ Z
7 [% }8 h& A$ r* K; q% K
Minimum = 0ms, Maximum = 0ms, Average = 0ms
; T/ M) D2 b4 \8 z Y0 D ; W" G- I- g9 I+ a
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
" d/ s* |7 i# w! }/ t( v: n$ n( l% f % q. G9 t6 y! c
-n count Number of echo requests to send.
1 F& F% L6 }3 @' G6 r 4 L7 |# G9 @- F8 r" C! r, ]* q
发送count指定的Echo数据包数。 ! N8 z* d4 L( v) l
# H: N6 y% d8 M6 v" L; M1 [
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ( e( }$ g# ?8 |1 g
$ I0 j) S0 k& ]( e$ {" X C:\>ping -n 50 202.103.96.68
; R4 q+ Y) E+ [) T7 g+ P; {# Q
6 {) i' f6 \( J& g" N s6 e Pinging 202.103.96.68 with 32 bytes of data: Q, T% v3 X8 e1 x4 A
/ B) f; p! Z! Y. {3 E( ]
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 V( E9 D# m- J: E
/ Y4 E5 A7 q$ k Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 R% i! b9 Y; S% Y/ N% `% h# g3 f ! Y$ p2 ^# O7 |! ~) n) m. M9 r+ P% @
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
, [/ w+ ]( o" f$ @# ] p) s: P d: @( p: C0 l& f U
Request timed out.
- `# w# M8 X: C6 N5 ? 4 e- X. N; Z1 ?4 h: y
………………
3 i0 Y5 V/ F+ `, ` / L6 k+ D; S7 k, W1 b5 a( W
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 M! {' I0 g8 y
, D; A2 t: o; H- g: o( | Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; l3 g2 @' R1 {' W( M& M5 E
8 ^. n6 I# I; N) w& ]
Ping statistics for 202.103.96.68: * x# b( L* t }' [
1 C+ m2 {; H1 g8 P
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
q3 g5 ]2 W: Y6 |# U3 s! {4 [1 T
. Q: H% d: R* G; ?0 w0 ]! V' _& B Minimum = 40ms, Maximum = 51ms, Average = 46ms
8 _* b: P/ t! W- M. J * [" R p3 ~6 Q/ X! t. d
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
. t2 e* i0 O. ~' H+ K ) I& [& z! \, g
-l size Send buffer size.
- U1 S$ Y. I1 D2 G, D* r 9 V2 k" b1 [ ^' }% O
定义echo数据包大小。 |
|