|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
( _& f. h6 |) p, s9 y( V, t + @$ a# x! a3 N# i- F- V
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: , l/ d3 x1 R" ^; Y5 z) ^
1 G; c3 U$ ]' \! G m* j
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 - H0 R) ]0 m6 u, r
4 A* P2 L4 ?6 O; ?1 O& O
Options:
( j& Q: X* s6 Y
" O5 R/ v' a4 n( J6 W$ J -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
% l; L0 a: c5 h% E6 A8 b/ h : _. g3 ]2 W& ~* q/ d. J; Z, F
不停的ping地方主机,直到你按下Control-C。
6 v( { x8 B7 z. s* B j1 ~6 ~# U1 q/ r6 ^7 c. U* k
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
: _2 a0 V: ]! o8 ~3 I$ l % u. i6 ^* E5 X0 X) f9 X4 _
-a Resolve addresses to hostnames.
& x8 b ?- M1 a/ Z, j9 c5 ^, N
- p3 b0 y$ U0 ~' I) ?; h: I 解析计算机NetBios名。 & l j3 y: {* \3 F7 E: f! c5 B; o
, e S" f. \1 X 示例:C:\>ping -a 192.168.1.21 4 ^" N" a& |. _1 p$ k2 z* e O
3 x) Y* T2 H4 g; { Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: , X, n6 ?( T$ V! i6 ]$ A C# H( P
- G5 o( y5 x7 J' s1 N- r; c
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( Q* Z& E, z1 I; b4 O
- m* P9 |( E$ k% E
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
* u. |' e+ t1 G/ A& |, S `
( i" R" G/ U" n& v Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + \/ t4 i& [8 N& y: W
+ T4 }4 q) }: J/ m' w
+ |- a! h `/ h% G% W Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 P; v. ?1 U9 d% M
* p3 {$ P$ D4 z* e$ k, v) @9 e
Ping statistics for 192.168.1.21: , i, C( |8 h {+ y# E0 A
5 B1 [$ a7 y$ e
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
" Z" a5 ^1 ^" E/ d# O
+ d- ]. ?" {3 A/ S9 [+ e6 k Minimum = 0ms, Maximum = 0ms, Average = 0ms ' p- s: q" B6 x4 d/ l
1 q! F2 |+ G" ]) a3 ~9 U9 {
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 1 U! Y* W/ l# n3 `4 ^6 z- i. P) ^
; o) A; y. k# p! \8 G; s2 _1 W
-n count Number of echo requests to send. 1 \! g; g; L6 v( U8 u( K) n
" w* B q+ A* {$ [2 S 发送count指定的Echo数据包数。 5 ~, h7 m, U# s! _+ i' A
* S7 g. z$ F( Y) i1 c& e$ f 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 7 L/ H4 A9 D5 p1 y5 {5 _
! R& _$ o; j$ w3 \7 ^$ ^ C:\>ping -n 50 202.103.96.68 0 b- V+ W$ u, n, c f
& ] {/ P' j. Y% B# H. F Pinging 202.103.96.68 with 32 bytes of data: * U j3 I6 ~0 {
* H% m5 E" m+ I" X# w) z, H) p
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
}# m; f6 o% b( {4 m " s& {; Q6 i, L& y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( p8 E6 ~* l0 o6 M6 y% l
4 b* ~3 x3 ?& G; V( O6 Z! q
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 F) Y9 i6 V9 Z& s
1 A0 D. }2 ~6 @. F2 E3 w; ^6 ?
Request timed out.
! w" D2 d3 ?1 ~/ Z6 u/ ~; A4 L ! u* S' N: k" p( x n6 D, R( k
……………… 8 i! m5 L. ] v6 D9 R5 N3 p4 e8 ~( U7 G" c
1 n+ I% O$ Y& i) ?+ s, Y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 8 P& m) e$ C4 e3 r4 p0 J6 R2 G
2 R8 d l' u6 y/ S
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; D4 R7 m9 }1 Y# X4 r
- W" I; X- U. M( R$ r5 u Ping statistics for 202.103.96.68:
Q! z& {& e) z& Y- A& Z
j. e3 z, P: C0 n: e* f7 d/ I Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
, @; i6 E0 r7 u% i" m# A) U& h & u- H0 \6 }: Y& O }* f" B
Minimum = 40ms, Maximum = 51ms, Average = 46ms 3 S3 m7 b7 y `8 m) p8 T- e: i
q5 z* u( p% t 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 2 L- @6 R( U E6 M8 `9 @
" P. ?9 Q; {# H3 X2 V; s( A -l size Send buffer size. 9 i- b8 h1 T2 i. ~
, `- b' @ N' n) r- G 定义echo数据包大小。 |
|