|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
+ L1 J2 u+ f2 j
/ c4 d( \5 \+ ?, g 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
; F4 q/ c Y1 L3 O& k. m ( L; I! Z7 m5 S8 ~5 v @% D. ^
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 ' ]: `/ l$ |8 s8 {1 Z( ^
9 z* r! P9 j. K% N" ? Options:
/ e+ x, T: o. m( @. i
! v; X% n- f% l& l9 G M0 X) ~+ m -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. " Z$ o# [9 u% _ y
& ?( D8 t" y, U5 [( p 不停的ping地方主机,直到你按下Control-C。 ( c; d1 k8 I A6 P/ c, t
" X6 m2 Q- W2 \3 V6 N( X% A 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
v0 R$ ^ D1 y* Y
, N: A: y1 l. R) z6 n- _' i -a Resolve addresses to hostnames.
1 Q. t% A; o2 V; U2 Z! k- k7 Z' `4 b
7 j& R+ x' s9 A% A; G3 b0 x 解析计算机NetBios名。 1 x8 N7 U0 c) ]5 Z) ~" J) W) W
" h6 j' J; Y1 A- J" ]6 v
示例:C:\>ping -a 192.168.1.21
, X1 h% c, b- `+ K7 B1 D 6 o h8 C/ X2 e
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
& {; C; z0 W8 S5 `: T- @1 o2 g n: Z0 Y% v3 Y/ a4 F
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # g; H+ ]4 L: X' S
. B m, h/ V* s V/ J( [& n/ V1 q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 U" { i; _5 q& M& r
3 \5 {: B3 _0 _; u& a
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
3 i) f- F9 S0 a. P% B1 X0 {2 l1 z4 G7 X$ E) X0 ^
# a4 x' M- M, E- k& x1 B7 i
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 {/ H7 e* z% T9 k8 q2 m# }8 t5 z
" u. [$ g4 b5 A, v$ Z
Ping statistics for 192.168.1.21:
9 |# F$ R) w1 p9 l; C1 c% ~
7 d% V: d1 W; v! K a Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
8 u B- n- `0 d+ O' M $ C8 b& e4 ` U& h
Minimum = 0ms, Maximum = 0ms, Average = 0ms " m' G$ O; d* \6 E
" G) g3 q e3 l* t- }
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ( @8 i& x: Z5 D
3 Z+ L7 q+ H& i9 f# h1 o2 ]# \ -n count Number of echo requests to send. & X/ [6 @& k5 ]( F! |1 d
5 g* Q+ S& O' R
发送count指定的Echo数据包数。 4 C* r; e; |3 Q, |2 c
7 e# U5 V" i8 ?8 G
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
: p4 f4 H/ ]) D8 I2 V ! L. O* _' W6 K1 X0 ]
C:\>ping -n 50 202.103.96.68
: T- J. P$ |3 o2 k
; E4 z! a5 P: D) x Pinging 202.103.96.68 with 32 bytes of data:
9 `. ~! W. ]. @: I ; _1 o( o) h: L9 r+ A5 {, b! N
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , h! z% W. P/ e; P
2 n2 W7 h+ M5 \' H7 p6 Y5 N
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; q7 k. K8 N! m1 V1 E! W4 B 3 A8 L: _* `: ]; K* Y/ [7 v" o/ O
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 " [: ?& Q3 c; S
- \ ^' E! B' G& ?
Request timed out.
* p ~6 v6 @1 c
5 Z w6 `2 X: @ k ………………
1 V0 L9 c% Z3 t7 ~ |2 h# y ( j2 S: I* q3 S: A4 }, M
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * E" w- }7 E1 D3 j8 b! q" N
; J$ x$ U9 l; F Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 ]; F$ J( g R
) g- L. @: K) C A. {$ l# w Ping statistics for 202.103.96.68:
: X9 y0 f" @; l5 m
) a& n4 |' y) N; k5 V Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
' H, D+ j. z/ Q8 z1 V0 M
0 b& w! X1 k8 n& _1 r Minimum = 40ms, Maximum = 51ms, Average = 46ms 2 R+ @) ~& b3 W7 s8 r5 O
6 }6 k8 v7 x: h
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
0 i5 [1 M1 P- _- I* n* d
7 `7 f; X" S3 {- ?3 z1 ~ -l size Send buffer size.
4 K, u$ ? S, Z- }* U- I 9 Y9 t S8 Q- x/ ~' w
定义echo数据包大小。 |
|