|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
9 A( a* Q$ Q7 v( Z
$ _' e8 `7 l3 L0 Q! v% B0 ?3 \ L 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ; r, `+ C' d6 y$ Y2 @9 j* B0 N1 j
w1 A* E8 N# o6 N 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 R; l# \& o& M4 h# ^6 z! s8 f
3 T) q1 |0 U$ e! m& {% i
Options: $ ~$ W' x: }: |, G0 h
( N) V4 W8 ^5 q1 z9 G$ D6 p -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
% ~3 ?* Z( r* ]0 U 8 Y% ]" j2 g6 |( r
不停的ping地方主机,直到你按下Control-C。 : A, F6 L0 ^+ p3 N8 S
, d, S. K* @0 o, G! [0 c* m
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 " T- D/ f* \/ `( h4 f& ^$ l
% a0 @7 h) e* ~( q ]: {3 q( D
-a Resolve addresses to hostnames. 0 | |5 O$ r4 l( d: p
) l- Q+ i: P/ h$ Y9 F 解析计算机NetBios名。
! I; s8 x4 h7 j6 d : c k2 M6 ~" U& t; O
示例:C:\>ping -a 192.168.1.21 & [" q1 D6 {3 _; d, O" ?
3 t2 |+ J" j. f- l/ r2 p
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: ( ]6 ^8 o [0 R, N
. Q, [* K8 H- a# @# i; b Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 $ n! t% U* F" Z
: A$ \* k$ N8 `& F; O4 d7 }- b2 |
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) G3 @/ F! m, [5 d: S! C# [ 4 _2 q. O) [+ f8 F P+ Z! d+ ?
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 @/ [* n7 X( ]% A. `6 m
8 R& q6 F2 c0 E5 K
" [ o' [2 `: \! n7 o* G1 `% S Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 e4 E* R( V3 y: M8 ]( l: H: ~ ) r* b ^; R' z6 \9 W; z$ [1 l
Ping statistics for 192.168.1.21: 7 ~7 v, F- T5 L% y6 V! h
/ \/ w* b; g9 Q1 ? Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
5 Y% d4 o. M8 g2 N" E- C
9 ?. f1 Y2 G( |& U' a9 X- Y Minimum = 0ms, Maximum = 0ms, Average = 0ms
& [, y- j2 o6 }* Y; J" ~4 S
* I; j$ }2 X' N# e" X# A2 b 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 , D. H @) t$ {, {. l
: p, `3 K1 p- C0 ]; v
-n count Number of echo requests to send.
2 x P5 F; V3 r9 _# |9 \. C
; [4 J# m# u) x 发送count指定的Echo数据包数。
( D3 N5 R @; `/ P ( D: z9 |* w V* `" _' E4 z/ A
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: " x" x! V G2 S1 D
, f0 e: V$ Z% G6 O% R C:\>ping -n 50 202.103.96.68 ) h, N4 W: G6 T$ ?8 s
2 R! b4 J3 Y8 R% X9 ^! J
Pinging 202.103.96.68 with 32 bytes of data:
3 U4 D; n4 a$ W3 V7 ]- b3 c
+ P5 S5 C- G% A5 y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ `2 [3 E& M0 o$ |/ T% I w
# n' J) P4 U6 @- R Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , G) L7 ]/ }& n( d2 w, W9 Z2 j' |+ F
) o+ _* F9 }6 O/ i% y. h Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( Y6 E* A0 k* @+ i0 U# V 8 x8 v, P `+ X, z/ r
Request timed out.
" I% U* f8 j) \7 d ! R( R* j1 b, |; |5 F
………………
8 K5 _9 n: q5 S
5 F0 Q Q+ Q+ o: d( K6 _" ]/ D6 y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 P& u" p! \% F3 e! Q; a# k
; j; @8 A3 b1 z2 B! y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
8 F. r" S* C! W: s . k/ O* D! {. w4 e, ?" z
Ping statistics for 202.103.96.68: 7 Y, w( G, } j+ b, t/ y% q
6 i( A: j* l# ?6 D, Y Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: / `4 m( q: Z# C% P
: T3 Q7 A6 s9 P* w. c
Minimum = 40ms, Maximum = 51ms, Average = 46ms
4 I# x2 U! b/ @$ [5 u+ ~
2 h: T6 ~% \& a- \ 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 ) G2 q2 a3 H4 |$ S
) n% g' e# {& J% A6 z -l size Send buffer size.
3 u5 m$ z. P5 H3 i4 b7 ` 8 x. P/ j2 _6 q$ l2 T1 c
定义echo数据包大小。 |
|