|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
' ?0 v) q0 g2 A0 s. g7 Q , D- I [* N& ]. g& j5 A: W
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: / Z6 X9 Y) V, W: F* l V
4 m: m% y/ T4 Y$ [. m! o Y! M7 X
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 m2 ?1 @! t) r k0 f; K, C6 S
" `" r/ U& ^" {6 D Options: 9 M0 N% T) H% W7 V7 D" ^
$ \2 o( Q9 C$ x, m! }/ t. a -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. - H* X. K/ I. d, n0 ], E1 {8 X
N8 C: `$ V. N: J
不停的ping地方主机,直到你按下Control-C。 # w. c) T2 j7 o: B0 @+ Z/ T% a
% N$ F" T! l, k( U1 P | 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 # I5 k1 x4 y& r
3 L+ G5 I' [: a" P) T* N
-a Resolve addresses to hostnames.
3 I5 @3 r+ }, Q2 X 2 t# k+ c: d: `2 F1 V9 a
解析计算机NetBios名。
% m( c/ U; Z$ u2 `) n" d
3 l w I2 N7 l8 m3 p( h 示例:C:\>ping -a 192.168.1.21
7 T9 [+ ]# e& j1 `; W& d ( @3 ? y* k3 u) ^
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
/ A- n: A5 \/ ^1 N+ { d6 D 8 p) _ X" I0 q4 w' ~* R' ~) C1 C
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
( m( t9 D- i) G9 S" w8 {
9 A/ ~( j' F" H$ s Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! d( s. ~# ?6 u5 f9 Y- ] + X5 I) Y& q3 ?6 k# ?
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: Y5 ~8 c3 f+ I2 s% ]; d5 }, F2 L3 p
+ ^; y9 T$ H. O/ F9 `* j, J7 \, v
l- r" Q3 m* G5 e' u: Q) K Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! \, \6 y2 o4 |; N$ V
1 |9 k/ O0 n$ s Ping statistics for 192.168.1.21: , y# v* r, L5 T6 U u- ?2 t- z5 c5 p
- Z1 j* r/ H$ {0 }
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: $ U2 R. m+ W7 ?
$ N, S5 x$ [+ m Minimum = 0ms, Maximum = 0ms, Average = 0ms 3 J, ~6 n8 ^$ G5 y6 }' p
, b+ f1 o+ {+ ^% e+ y8 N% q9 |' g 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
: p, c7 w' V! w9 o, {3 [' L
) u) c0 @( i+ b -n count Number of echo requests to send. & x9 b; V& z$ w
3 d2 N6 c, J1 D! [( X. s3 ~
发送count指定的Echo数据包数。 $ ^- e* |6 J7 J$ m/ s8 g% h
$ U! I' ~% @" K 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 9 W' z+ D G5 h
7 |9 q. r# I& ]* n- h
C:\>ping -n 50 202.103.96.68 - P# L2 v2 A! n
* m! r" w% L7 |6 T) S1 N
Pinging 202.103.96.68 with 32 bytes of data:
# A3 }3 q; ~, _" b( [3 O
% {+ `2 b% y2 V$ J Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 c) _" B0 @9 h3 d; Q
], I2 P. G+ U: E- R4 @ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 B( \$ S9 X& l% _: W
% e% Z6 `, R4 [. V3 _3 p Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 r! C. F* e* \: u, ~$ B / k( p% {) m6 Y4 [* K, r
Request timed out. 3 p4 b& |' W) m5 i: a' b
5 W( x2 T- O* t4 t# t ……………… & w5 c3 V: I1 M( e) P& _
! R% Y8 I: T) @6 R Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
9 j2 R3 ^6 @( S+ b
' Y* y8 F2 E6 X$ K6 v Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 v" G: b5 |4 D$ G0 l! @4 o% Y
) Z: v9 z2 b3 ~$ ?! ? Ping statistics for 202.103.96.68: 6 R( o$ Q- h* X% ^
( ^3 _: Y8 q, G6 T7 t7 A
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 8 q/ e6 y% C" M$ r* O- J
! r+ i. l% e; v, @% T/ S
Minimum = 40ms, Maximum = 51ms, Average = 46ms
1 x) H1 g% b9 a9 g/ {" x- N" k 3 l0 {; q/ X$ {
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ( \4 N) T6 Z8 [" Z" R
) n( W6 Z+ p9 h) V' p
-l size Send buffer size. % D: I: ^3 m- i/ G3 d6 R+ z0 @
. s& y. x% V% L% _$ F 定义echo数据包大小。 |
|