|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
5 ~, m& g" s k1 T o
, s9 f' l+ h5 H8 H$ W8 J 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
- ^! n# j) s0 {9 s8 T- b
& n! @: [% Z# Y$ z6 Y. i0 \ 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
5 {; m2 N. f7 l2 j2 [5 ~! X+ v 9 s5 e" k$ M$ G6 m9 K, E
Options: 0 E9 |2 U6 j9 W2 t
/ \, ^4 e- A6 W1 w
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
! q. ~, h$ o( H2 p/ e i% x' |9 F* v" m Z, X; d
不停的ping地方主机,直到你按下Control-C。
: L" {/ J* a8 f5 f% k0 ]. r: s
, r, h% ^9 P/ X$ b0 H% C$ Z 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 : Y0 A$ {' T0 @0 c* }" L
* U" h. O' b2 |/ J1 O2 K: o -a Resolve addresses to hostnames.
+ S5 v+ }. |5 w# \
! c8 ~) o( W: ?) N: f7 U 解析计算机NetBios名。
0 f! a$ D5 W* I0 [3 s$ |
' l+ B0 ]7 O/ K$ { 示例:C:\>ping -a 192.168.1.21 * G' ]. K/ f2 \' G. o
' M5 l( H* q3 v/ |
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
, U) P7 p# _6 ]/ N$ r6 @ # a- Q9 F+ ] U W F
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ) v" L: {+ ]/ Z& V3 V b
! i/ S7 ]: ]/ v Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 Y, g# |' |" a6 I1 v% P1 ?
9 Q& w) K: J1 Q. B
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: \- j6 Y( {$ c+ P5 {% g6 K. Y3 @" m; q4 i! O. x: p1 J
/ ?" Y: g3 Z- E4 x3 `
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' E) m0 Y! R' i4 N2 t
3 E# T) t% b: Y4 o6 A2 {! v0 k, w Ping statistics for 192.168.1.21: 1 l* y% V h! J6 S1 ]
) ? H0 J+ R. X$ s, j" M. D3 m Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
T) j6 j' T* [) `7 l 0 S- j6 ~5 v- J) ]$ T. a
Minimum = 0ms, Maximum = 0ms, Average = 0ms
" d. D0 F1 q; x $ ~, r% B2 B# q7 G' [8 }4 x) e4 R+ a
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
3 t& M" a/ ?7 d1 T1 X
& n X1 p! }, C5 ] m. | -n count Number of echo requests to send.
/ a) r% w. ~5 U/ D5 D; O9 w$ Q # o7 q4 G- k- I9 I) L
发送count指定的Echo数据包数。
' I7 c* ?+ \$ z. u( M 3 @; b- e; g, n' g0 R7 R% }, K
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: & r. u2 S o' n! Q* d
! u: w: }; o0 x, Q. R C:\>ping -n 50 202.103.96.68
' Z2 h& ^% m$ Q/ y! o ! Y$ ^4 Y; n: S0 _1 _
Pinging 202.103.96.68 with 32 bytes of data: 2 ]& R- h J0 Z* {* U2 C
n) p- O3 @$ W: A( k
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" k% W( C8 o( e7 ?- v3 I0 ~3 e
( N" h( I) b; [; @* n Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 `8 H% T- L4 L7 ]
* ^* @8 j/ j) S! u( C Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; x5 ] ^. o) ^) \( `- J2 o
2 x" K- Q' t; H0 @ Request timed out.
7 q/ {/ z4 c; B) l0 t
+ I& e% {4 [. [8 y4 }' Q ………………
. a3 H; i4 z. H% G5 h x- E 1 X' Q' `; L( [! ?
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : @/ |% b9 Y+ T, q4 s% P9 T8 {
: P, B) y! J" I) N6 Y8 u; @
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 o! k. `# d% M4 a$ m
: ?& H% t5 [, ^; }$ B Ping statistics for 202.103.96.68: 8 {2 \5 O/ E8 z
7 e" Q! ]. w9 p- ~
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
4 h* Z( b1 v2 b S3 x" O8 G+ v
4 k/ K" ^: E' ^1 W, t- q Minimum = 40ms, Maximum = 51ms, Average = 46ms
+ B) U& B1 X2 u. j) Z3 l: k 9 z, B8 b$ G6 H9 d, r5 I! u
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
0 k& C8 c# H! Z& i) z5 P
8 x* W% m& t/ Z7 Z8 y -l size Send buffer size. + c6 q. a1 R4 g$ |7 l# A
. u& w. k+ ?4 {, V" t3 _. ? 定义echo数据包大小。 |
|