|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 h6 o0 A- O r! q6 _9 c" r % A0 p; ]3 q8 |% a9 g$ g
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: + r2 @3 G7 U, B3 V/ v
" x8 ~( |/ W' @( k8 F0 Q R
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
+ p: `1 `3 t0 U7 L `
2 ~6 p4 X$ r3 {" l; C" l0 g Options:
, s+ {; D' u% A: q* u0 t
1 S0 }- H) E: R _' Q" F -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. . q7 @4 _% V0 u$ d7 T& v( ~
2 w4 l, S/ X4 H) t9 Z8 x 不停的ping地方主机,直到你按下Control-C。 0 c4 P9 s* j ~, ]
# K7 @! c4 x: p' R0 D/ `; E 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 7 c1 n- V& ?0 l
2 X" b* O! s/ `
-a Resolve addresses to hostnames.
: d( `) S4 T& A H) \3 ?) B
: ~5 C/ T8 z) f/ L3 r 解析计算机NetBios名。
, ]+ P+ ` Z! [
5 H5 Q: \) q' C- N- N! }2 C R 示例:C:\>ping -a 192.168.1.21 . _. z9 ^1 x0 J. h
) [* p8 }5 i8 k8 l1 W, B! C Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( Q3 g0 B' I7 a% V3 a
: Y' O3 P: E1 m1 [' U7 ]- N' k- k6 { Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( H& w/ ?4 f0 H, t6 P
" Z' H$ v2 m& u0 Y! Q# |8 D Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
5 ^# j) b. d; f
$ j2 G# W p8 l2 s6 ]. e5 x8 o1 O Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 Y0 l1 J: X" J. w# m/ W; D Y7 R- M1 R, @- ?$ f
0 g' o& Q, Z5 K% F- I* H! J2 V
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' _ e5 T. ~. q9 Z& b/ ?8 y
3 b1 h+ c9 c7 `0 c
Ping statistics for 192.168.1.21: + u- T3 |+ u$ W3 U
+ p5 \: S; L% B5 L4 c F4 l! t/ N2 s Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
& i2 f" ~/ q% d9 q4 Y0 |1 B: S 0 e& @& k: _ N# G- ^
Minimum = 0ms, Maximum = 0ms, Average = 0ms
0 U, O6 x1 K* N+ Z
+ `1 f; N, ? c% O8 N+ J9 ^ 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
- D6 n+ C `1 [0 C2 n. j
; j. A# W% |' m -n count Number of echo requests to send. 1 Q- d$ l0 ^$ U8 [
6 j' T- I# f8 ?7 D 发送count指定的Echo数据包数。
3 N5 Z% L' g( v8 l* j/ V
! Y7 t2 N* B8 o9 ]. q e 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
4 N1 x: ?0 r5 J) ~! h8 |
+ B4 l% {) y. K9 F C:\>ping -n 50 202.103.96.68
' ?! Z2 s2 F; x2 } 0 u# ]$ w! d' @
Pinging 202.103.96.68 with 32 bytes of data:
+ n0 X ]* J9 X' R7 w: E$ W & o/ g% Z. f/ v8 A& U& u
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 v0 J( K: z4 l2 {7 p( o
6 G- V( j9 L6 U Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% t2 V# f6 U2 i, l7 G5 g" _
6 F8 H3 ^" V T6 r Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 n( A, p6 H0 j
& A2 W+ u( l8 Y
Request timed out. - N; [# |" ^7 N, j7 c% z% B
) A M8 ?0 y" w" f$ }$ t ………………
- _5 F/ z E- v1 T4 d
6 \, D* {/ Z5 ?! Q+ D+ E7 r Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* t7 L; t. L# f. ~
$ ?1 O ~7 U; y4 Y: t( i Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" z* U2 Z |3 u1 {( h
6 i/ t3 S) l' Z$ _2 } Ping statistics for 202.103.96.68:
% v7 y M6 z; E% A9 k
- u5 L& X2 j" ]# K/ N" s; P4 E7 {1 y* W0 S" P Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: @% y' p. g3 P4 d
; p* W% P& p/ k' G+ f7 W# i
Minimum = 40ms, Maximum = 51ms, Average = 46ms
' l; C5 i' Z7 U3 Q5 |4 `7 K
4 v4 l6 K2 B% B- @, X3 q 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
3 _5 K Z0 ~$ ]# T" G6 p1 o' I3 |" P / k4 H& u! W7 x; i
-l size Send buffer size. ! g x3 R. Z/ s: E( Z
' U! E# I* M. l 定义echo数据包大小。 |
|