|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
8 T6 J. }( i+ e5 l1 h% |
) F& h( [ i6 I. i4 M 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
; O3 s/ w( p: S1 R5 M m U: P6 O# Y. L # L' I, R7 B5 e
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
, g. m `8 F2 I7 J + F6 x. R6 y* Z% {: f
Options:
* @$ B5 Q" i, {
' L! F+ J/ u1 i- Y -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
; W2 F+ K# ]5 v! |4 d0 _9 k! d. y) g % d- ^* q, j& M! ^" r1 c; t6 b* p
不停的ping地方主机,直到你按下Control-C。
( U- H& p& U6 Z7 t" {
' e7 K( @- W7 L; P" ? 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 5 h! v) Q( [7 q( \0 f
+ p( I! e7 H0 m1 x. Z) h -a Resolve addresses to hostnames.
) c# A1 S& i Y7 Y, p! j 1 i4 u5 h+ m5 V4 J" g
解析计算机NetBios名。 + M0 y# }, B- q9 v
) E1 k9 |! Z5 N5 O% } 示例:C:\>ping -a 192.168.1.21
# l! C% c) E0 @9 q' s
. ?% p& P6 \7 M/ U0 ?) R5 o# r7 X: p Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
1 u; y) s& F9 y* X& @( c- h: X, e$ }
8 R; n. O2 Y Q8 T Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * O% A: p% Y% \3 W/ P
1 L9 M/ D$ I- `& }4 @: h- W
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! z7 ]- J! M) o ^ E8 R/ M
2 |& k0 Y& Z/ A Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / x: c N2 U6 b5 P3 A3 C+ B
! ^6 W9 U$ w" c, g! y
7 S' I0 e8 M4 `' } Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 }+ `; h# |2 b* R- x
, U- y l; Z7 K Ping statistics for 192.168.1.21:
! _( C. W q7 f7 M: \
5 B6 v. H' S, A3 E4 d' O( j, H3 ~ Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: , ~0 W* R" l* L
- | Y) J7 G* C7 s Minimum = 0ms, Maximum = 0ms, Average = 0ms
- c. ^1 k; ` `3 R7 }* O% L; `$ ?+ @ 7 f: Y9 c# d$ G5 }
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
F3 ]% O- ?+ X7 k/ K 4 J k, a) t7 e9 @9 {
-n count Number of echo requests to send.
$ k2 V4 l8 l& d3 g4 S X. ? 1 O7 S" Z2 @2 q' c3 v' N& x
发送count指定的Echo数据包数。
1 ?9 x; u& {& `+ N! U1 h " Y0 P6 N3 Y4 }& \- N/ T
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: * b. f! a1 o* f( [- G1 z
$ d8 W+ [8 B1 a7 P) m
C:\>ping -n 50 202.103.96.68
0 e" x4 x6 y, z( h0 l 0 c" |+ |2 J+ V) O% K6 K# O+ |
Pinging 202.103.96.68 with 32 bytes of data:
7 C( X9 _* W) U) i8 h
u0 L, l& M$ S, g Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 1 G2 W. h2 o1 x) q. W0 O8 `- P
% N" ]* s' P# i. H5 z) e
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% E# C7 a2 ~7 o
' o" B- t* s) `& C8 g7 `9 Y1 O Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" i( @& w6 Y6 a. {6 O- y6 F4 B
& s& h9 x& s4 `& T Request timed out. 7 n, f2 M$ ]) F1 l; }) _
+ t! e$ Q, ], U0 `7 Y! W ………………
. c1 }/ ~+ W) r: h# E- I9 Z % V* j; Q) w9 @" w( T9 Q& L
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
# a: a J2 Q2 ^9 }" o
9 r( c1 e$ b T6 f9 s# K {2 e% B Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % \1 d, D9 b0 a5 F. F
# Q+ T. n" O, c6 F% w2 J: y) F Ping statistics for 202.103.96.68:
/ K. Y" V, e4 _# A: ?% V. E+ f ; b8 g0 g& j8 q% {
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
7 q( R8 Y/ ?; L5 H
" Y5 L# W5 h% K- x! C8 N5 O) z Minimum = 40ms, Maximum = 51ms, Average = 46ms
! J% T8 X4 M: \! p
; I" B* L% X% Q# S. F) |1 j D7 i 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % o% F% g% e" z) t3 X/ d
; ~9 }/ Q) z7 p' @' W
-l size Send buffer size.
8 X1 @1 [5 Z: ?5 ^1 Q% K: }0 \ - a0 b- m& q! u
定义echo数据包大小。 |
|