|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 l6 X( \) m/ x9 @% y& G; @& G
* Z6 A3 o( H2 j; Y0 A, E+ | 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
! K4 u6 z4 [6 \: a5 V( P
+ h$ P3 T, n& G8 N. c 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 ! f" O# ?& Z8 J6 U
( Z, [9 ?9 A' {7 ? Options:
% D+ T$ O& y, C- h' C/ K1 O ) o2 X8 C- \; Y" _) L* `# p
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - D7 `; a6 W3 T
, |, }4 W* M+ d) g7 P6 J
不停的ping地方主机,直到你按下Control-C。 * E4 B& a+ t4 P! }1 L% W/ O1 w$ F
! @& c4 s+ s: X
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 1 ?, b) _7 e0 z: |2 k; H* C
]2 ~( L- D& S2 W7 `( t( u1 Q -a Resolve addresses to hostnames. 3 P* F1 }5 k; {. g9 I% o1 J* g
7 s& m' O& j7 P5 Z" {4 L
解析计算机NetBios名。
# s4 @. b9 b7 K0 G* c# Z& e
% p' C- T1 v- n2 s) ] 示例:C:\>ping -a 192.168.1.21 ; v# N5 @9 e) l0 s6 |
$ A& G7 ^( b+ A7 S
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: " i, h# b; l- c f5 b1 R
1 t1 A8 K- V; h/ Q+ Z Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 f+ f* d& Q! I% ~2 ]
" s# R4 l( v* M& I% Y' j Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 n9 W8 A+ c/ U# G/ w. s8 P! X, r; E 1 \( Y' ?* U Z* g4 \0 S0 n
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 P3 V! [ g' N9 |4 S8 Y' h$ S( K
. O6 q) K- V7 y& a
9 |% B7 i/ R$ R4 D% r$ b Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( D6 m9 X2 v4 c9 A
; |6 s0 b4 E7 }: s7 m
Ping statistics for 192.168.1.21: + h: V: Y/ J6 C" ~; L
2 |$ t/ k9 u$ Y6 Z7 D3 e Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: Q- F5 [6 R- f" e ' E& ^' \: n/ W; f7 y
Minimum = 0ms, Maximum = 0ms, Average = 0ms
& C! v3 a) x/ q. Z 8 [, i. t$ M' V& s6 M4 S/ Q
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 0 Y. @0 n/ y: I |: H
7 T) J! Y4 F1 l1 t) h! i
-n count Number of echo requests to send.
' a" u5 j( |) {, e' N. G
! k) [4 {, b9 A8 | 发送count指定的Echo数据包数。
- v2 ~; f H% y3 `0 f2 L `: x0 t, p6 T. n3 W$ v
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: & d/ Z7 ?' a/ ]- e7 }
: V9 C9 I. J4 t& J e4 G) s C:\>ping -n 50 202.103.96.68
, ~9 {- D; H- c# M6 I ' }% P. \( z& J5 g3 j9 y6 d j
Pinging 202.103.96.68 with 32 bytes of data: 4 n& { m4 |9 t' m/ w
] h" p: o: a+ V: [ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 p. C X1 u# W
% ~8 Q2 q% ~1 x. }( b/ s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : m6 d6 G' r3 O$ `2 Z3 R, n
- V. M8 D7 P/ R) e) ~3 k Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % U$ q0 M% l1 _0 ~. I5 @; z; a- u
' n4 f5 a: `' v h
Request timed out. 2 j2 M' U ^, B; Q
# i( H% |7 b7 n1 C ………………
) i" w& l Q: a: l- Y$ \* y % z3 z7 S* ]! L; B1 j9 F
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 2 E P! T6 Y7 C0 S! ]
7 }/ O; t( g: n, n4 ] Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* W3 N- f3 x; x6 \) m % X/ m5 `# V5 F9 F% B( P
Ping statistics for 202.103.96.68:
& m9 p9 f- F9 c $ u1 b3 L! a. w" [0 E# W1 |, E
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
' p' o) ?5 o: [6 Y; C( }. d& Q1 {0 d : k7 z2 _ |$ G% q& a, Y. D
Minimum = 40ms, Maximum = 51ms, Average = 46ms
y2 ]' }/ [3 g* i/ P: Z, b7 a5 K0 [, B
2 i% R6 s- o7 e+ K' F 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
. F0 i- b4 t, I5 L W( W y6 x
6 G* E7 U4 \3 q. A -l size Send buffer size. * v0 u7 j8 T* p
/ }+ X4 [2 H$ u! g0 q 定义echo数据包大小。 |
|