|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 9 `- ~' { N+ V& M
1 {/ y1 I0 p* c! q8 @. b5 W
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: % X l% n& Q' G: R
( `5 {8 x9 k) Z" L
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
& j5 r L+ j' Q! s8 } ; z k+ Z$ U; j
Options: 2 d0 n, v* X+ V" k2 ^& Z& E
- `& p$ T/ }- d! y: `! @
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
) X ^9 t$ y( F* o# ~4 X $ p/ Q$ d' b9 \8 B
不停的ping地方主机,直到你按下Control-C。 6 E# R6 x! f/ _! E( `' ]( R
+ k7 o6 C; Y3 A: D4 T. B
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 6 C% P2 s8 \8 P. W7 s+ `1 a
0 F& d/ C! I7 t; a6 V( B9 A4 g
-a Resolve addresses to hostnames. - S- \& [8 s I# R+ c/ V- z8 C
0 p8 S6 J u3 v) E( l; o
解析计算机NetBios名。 5 V' n. s6 M ^8 U5 c9 _5 T* P% ?
& |; c* D$ ^) q
示例:C:\>ping -a 192.168.1.21
6 \+ _9 V; q- M1 E 8 U3 R# @5 v" u2 X' M% ]! m
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
! p0 h, y {9 q& E5 r% z
. o" H7 d; S- b! Y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; x& ?4 Q' {; J# T- T2 D
+ t3 Y! o( q% U: W
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 1 Q9 b9 k( w6 d C9 A
# P/ Q# E: L, ~% B( Y- T
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! R- O7 x; |" C( d5 H* }; h/ ~
- W1 m( P, i3 r3 N! J( W
& O9 C( Z6 T3 P/ F! u Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) V2 g2 o3 e2 Y J* A/ H( j ) h. L/ @2 }: C! }6 g9 q. S
Ping statistics for 192.168.1.21: + u2 D+ \. u: g
0 \; A3 v9 o& z$ G) t# U! P
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
1 M8 E# ]% O! u/ `0 S; ~4 `
2 I8 m1 S+ f8 ^! n$ G Minimum = 0ms, Maximum = 0ms, Average = 0ms
. N& C* }7 Q0 J
: @, N$ z0 {/ g% ]) x) x 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 . [$ k2 s. G' T
. z5 O. y# w5 Q" ?. G( L3 K6 D
-n count Number of echo requests to send.
4 [( [+ b) ?" R- P( _
2 D- B9 d# a+ E# d) P& Z 发送count指定的Echo数据包数。
3 y! s( ^: W' K# m+ S ' p" \$ L, c5 l1 j( p
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ' {" f. c! t; Q N3 D
/ F5 A4 ]( Z2 L+ @ C:\>ping -n 50 202.103.96.68
9 t9 x9 c2 N5 F% O
- C; C% h) T* }/ H( Y6 O Pinging 202.103.96.68 with 32 bytes of data:
0 r) X4 S( P9 g, m5 j) {4 N4 | v" h0 i: l O1 Z1 H5 s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " v1 B1 j* E. @
3 S( d! l3 X9 s+ t$ f Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 F! Q( i1 o5 A6 |. i/ ~, i
+ l1 c; H3 _9 ?; Z3 }; z" _
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: Q! K/ i+ `( L; I5 p% ]
$ E2 } x' L, E6 ?6 G9 i' X5 | Request timed out.
/ c/ f8 n( r- q: X9 d* w' @ 0 v! M3 o) l- d: f7 S' u5 s g! f
……………… ) s4 E$ J0 k; _
6 ^, y1 ~, y) x5 f& }- a8 @
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 B3 |0 I& ^# p) Q( I! ?2 ^' J$ M$ h( z * M/ V% m! g6 ? D
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 o% U5 c- }7 |# o
7 B# Y3 j2 T% y3 h+ D1 |$ c
Ping statistics for 202.103.96.68: - Z$ W1 Y4 Z2 Z0 _7 M
6 p4 f/ [( S: [( E; A- W( p9 } Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
" L8 c- n' y# x6 D$ \
, X3 s0 O" V8 X4 y" m% u Minimum = 40ms, Maximum = 51ms, Average = 46ms
& r* A9 R' }% }& j! r8 v ! K; m* Z- e7 o/ @
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
, ]7 M3 K7 L6 @2 H4 h; V
( X6 s# o* ^5 O -l size Send buffer size. ( e$ N5 _1 c) h
; w" x1 n1 ]* ^' U& j- y6 O7 E 定义echo数据包大小。 |
|