|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
H9 Q) R( r0 k, x
4 I+ x8 g; S- m2 d) c' P 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: C2 B- R; L. U4 }
6 m0 B! u$ g5 C- S% [ y 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 : ~8 f& f9 w- }. }
# N, @- I: ?6 e; `
Options: 8 j$ e" v/ W' p) s
4 p/ L; u7 P0 Q$ \" N -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
9 ]. V/ W# m. _$ V7 ^, C0 ~0 F% L
2 ?6 o" p, p0 u4 p" {& B7 P 不停的ping地方主机,直到你按下Control-C。
) w- R: \5 e9 l% @ . b. t: F* U/ x- l- y$ y+ m
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
, ]" G+ s% [! [' C0 d: r a
: h) q' X; \2 |* j5 a1 { -a Resolve addresses to hostnames. X& f) w$ r( I% y
" L! F( B2 a$ J8 z 解析计算机NetBios名。
4 m% |5 ~8 v/ G! ` ! F3 d; D S# C" o
示例:C:\>ping -a 192.168.1.21
2 N: V5 v/ B0 w! a! N" N h9 k
, d1 A9 H$ E3 b) B3 d+ ^ Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ ]- @6 h+ q! B+ d+ ]5 h. |
% g7 g2 O1 W6 H( V5 X @7 @/ n6 U0 R& { Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 X1 S+ c1 @8 C5 a8 Z4 ^. | c
; K! X8 s, L2 ?" }7 U
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ O- B$ K; [* N. [ + I" _8 r- c" n
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; N+ }; m! h% u9 K6 X4 d: |+ q
4 o; V& J h* z6 t
' i! a/ ?$ x% ] Z Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 F6 f1 P2 \5 J+ M/ _' m
6 f5 ]/ ^" a! t% x: a Ping statistics for 192.168.1.21: . I: I( p1 X9 ^5 b
P% E# y+ e' `+ e Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
# Y; o, _8 T$ {9 O1 W
* z# ]" c+ c. Z; m$ \) h! m Minimum = 0ms, Maximum = 0ms, Average = 0ms ' U/ e, R2 F8 @, g& ^0 _( g7 _1 m- r; s
) c; N1 X' z5 x! \ 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 + P9 |: g7 i- b ]% E
W" _# @6 h/ P5 h3 E1 y7 ]& r -n count Number of echo requests to send.
; D' O7 C5 V4 V9 j! Z 4 F C+ s) X0 A
发送count指定的Echo数据包数。 3 t n: |; u3 ?4 h" X
0 l5 X3 d& z z) b2 m* _# [9 Q. B 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 1 p9 {- y/ r7 e/ `( n$ Q
: Y- v2 e( o1 S Y4 ?! a
C:\>ping -n 50 202.103.96.68
$ i5 A1 Q6 s. w
. P' s& p9 r* \% {# q- a Pinging 202.103.96.68 with 32 bytes of data: 5 I1 x: x+ z) o& z2 k( T3 b
; o7 K4 u: u0 m) @% ~3 j e% K. O! { Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 H/ z" u8 U6 S7 G . v( Z! K* B6 ~; u" a2 ^0 n2 c1 F* s
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 v! I2 K# ^3 t- Z U1 \4 n
4 [1 `5 l/ o7 ^ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# Y; r7 K) S5 x6 S 2 \8 ^' D8 l% b! j* B6 c
Request timed out. . e4 | D! ]: U8 J: g
+ W' R* e6 M0 j) o+ C s ………………
6 n) W+ R q/ Y: f
1 I( L; I/ r6 _8 M Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) _2 W+ s) q+ }6 B
9 q: ]) u8 h& d4 R! o3 J
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 [( D* m/ h: q - G" u. z1 d# m
Ping statistics for 202.103.96.68:
$ }' N' V3 A5 w3 P
) E9 a5 h$ G# v, P) d Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
& ^: n5 c* H, U4 q+ F: I / X( {( {/ r; Y i7 y( r1 s( X
Minimum = 40ms, Maximum = 51ms, Average = 46ms * j _! t5 [9 u. {, B$ b6 ?
/ y0 W+ `: y2 |/ _ r3 a% I 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 9 Z% i+ S6 T* j3 K& ]6 Y6 f4 ]7 [! S3 b
. o0 i" e' C) D2 k! F; {+ g( [ -l size Send buffer size. " {% n7 ]# i a9 D
5 h5 O+ U' \8 ?% [2 s1 Z 定义echo数据包大小。 |
|