|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
0 n% |& r) |8 R2 `
# U+ L5 [5 Z9 n% b+ x# c7 O0 H) t 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
7 c7 V& F! r. j J4 X% B. t
$ _7 }( O2 x A+ H0 ~ S 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 6 @- \: d: f2 X8 r
2 k# b+ X( v, y) r6 C- d; k) M% P Options:
+ v: H# x3 K9 p+ ]' x
7 h6 ~+ m, W/ Q" F2 X8 }8 T -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
7 f6 n. Z% I: H
% ~" B6 I4 R \8 O4 n: a) ]; k: X 不停的ping地方主机,直到你按下Control-C。 . w4 V/ n7 \+ x3 y5 x+ B5 U. Q: }8 v
) @# {7 \8 {! ]! U/ K3 Q( U
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 0 R8 P3 @$ l0 Y! Q; m* _3 E
, H3 k: I" M. c9 B) m -a Resolve addresses to hostnames. - n" C3 R+ ]9 e2 _" [( z$ L
+ Q# K! G& r8 o* O \
解析计算机NetBios名。
. \- y: k2 ~* W, b * G' G l# h! y0 _
示例:C:\>ping -a 192.168.1.21
- Z1 C- o d$ f2 c; K- k) Z0 ^: }' x
3 x R8 @7 S0 C+ k0 W1 {6 l Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : A$ N' ?3 n& w7 F
! B6 H+ j. O1 p! j8 ?9 ] Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 u( P, T( s# ]4 C8 g6 j
" o$ I. X4 c6 M1 H+ h. J
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : i5 i* a2 y) [) z* |) e* H+ h
! [! ` B" Q2 X/ k5 f; Q Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + P) s* g9 h: u) P
7 u% w" I) G% A! P/ L
. |1 G, p" |' N. ^ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : x. `! g3 {; c6 g
3 s, a+ w, S2 C$ d N
Ping statistics for 192.168.1.21:
/ e' [# d& e9 _3 T7 @& w2 D6 L
5 |) g: V# p+ d: _ Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
- g! S1 r; |1 R5 E
, X+ ~$ b! F7 L8 a* ]) v/ \ Minimum = 0ms, Maximum = 0ms, Average = 0ms
1 u _! u. r: ^! l4 f 9 y! e- P: Y3 }% W" U* |
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 * k" C9 U3 j8 ]
3 ?* k& [ l; h" s# G4 l
-n count Number of echo requests to send. 7 x& |6 u# l9 w5 e8 _( G% G+ y
7 O9 T* e' q$ ?/ {7 w 发送count指定的Echo数据包数。 + z, U& r u7 I( `% h% N
$ N! R5 R; E/ I" r 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: / D; s; `9 z& C8 L
, ^2 B& V; w1 M8 |
C:\>ping -n 50 202.103.96.68 3 W8 y4 n+ A( Z9 h+ Q
# q3 n3 U8 Z* l/ |: f Pinging 202.103.96.68 with 32 bytes of data:
7 L8 z* l9 F1 @( o
7 v4 i2 a( \' ]# t, `- U Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
M/ ]) N* P5 W: Q' _
4 T& h C$ ]- a. I Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % X3 C$ U- t _; w4 i
2 g3 v" H0 {! N( h# f9 ^
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
& _$ r3 a" i" V1 q) N A7 E D- l
, I- X, o# @) V# x8 [ Request timed out.
: ^$ W4 R+ Y1 ^2 A" b/ F 7 j/ R6 t6 G! u0 v5 b) [- L1 N
……………… / D% Y5 _* m) G0 y) g) [
. @% f" P! u1 e0 z" N) [! w1 ^
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 g) |1 y. ^; n: V0 X9 j/ R
2 F- V8 L: r2 L2 l: X( g1 q Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 F5 L2 q) f5 b( Q& f
) A1 f* s% h/ B1 [
Ping statistics for 202.103.96.68:
0 G" S( \3 u. z; p/ B) j - p# g' m0 n, A
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
1 E+ E. G# Q* t5 F1 H. @8 ?9 r
5 z0 y& z$ y# c3 D t1 @ Minimum = 40ms, Maximum = 51ms, Average = 46ms 1 Z: _! Y$ a! _6 \2 C1 Y) h0 K
3 X* b- ^6 r* E6 O, j 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 7 [5 w# [+ C, I: P5 s( W
3 I+ |9 d: Z* \' \& f5 n -l size Send buffer size.
0 E+ F, W) p2 H9 l2 S8 c( C- R4 L 5 N) k* T- D5 ?
定义echo数据包大小。 |
|