|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
- q/ P" h U6 e
9 [; I% K6 R+ q; Q) _ u8 [ 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
; Y0 L' t" {/ w" f6 M9 F b; s. B- e2 H' g! _
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 : e7 u* c; d: V4 X% |% j
2 b, X9 U& f& y9 O, Y3 S( [
Options:
' `- F$ e0 t/ u. { # n- v8 L$ B3 Z( c- m
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. / K, H6 ]. e* o2 j8 K8 b% q
1 | y, e1 v1 a
不停的ping地方主机,直到你按下Control-C。
; Y' I8 j( E7 o+ s7 _
: o9 [% @' m O, s7 q* f1 [ 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
: a2 M+ C& h8 }; u8 f1 Z5 E, x1 o; F
; B8 ^& E4 q" s6 m! g -a Resolve addresses to hostnames.
_6 W+ k+ i9 ]" }* {$ M5 @ 6 ?7 C7 [# q9 [0 d
解析计算机NetBios名。
, k6 i q" E [
. u# X# V( A2 x2 w" J" v 示例:C:\>ping -a 192.168.1.21
0 f" f0 o/ |- q# ` " c8 e; Q% h8 U
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: + i- k" k* x0 b8 E% _& C+ a6 J) w
6 o. C, P( `3 s* Z/ u/ ]
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 t/ A V, j% u! l( d- ^" c
+ T4 Q7 l8 U2 x6 `. A V Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 @+ n9 _. S* ]; p, g1 `% A6 A- S* r
' f3 H, h( B- I1 G2 v
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
' ?: t- A5 x: ]: R. l8 e" h
" |+ ]! y9 Q( t7 {7 G6 w* \ n
) ?/ S& `) [& [$ ? q9 L, C- K Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # i( y# Q! `+ Z$ Z
' v3 {% U) j3 b- G) F
Ping statistics for 192.168.1.21:
8 m" {' @; ?' j+ O+ s' V 0 g9 i" Q- e' r G
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 1 f& b2 R5 N+ \6 A1 Y
: D- x" `! d1 n# ]" u9 R# P Minimum = 0ms, Maximum = 0ms, Average = 0ms
/ A5 M, x" S+ ~ 4 q: t! r3 I0 @- W: Z
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 + [8 `) t1 F0 g; Z
: K* c/ [- m( \" b
-n count Number of echo requests to send.
$ ^' w6 V: ~( Z" h 7 N7 b" p7 E( m0 S/ |8 O: [9 ?
发送count指定的Echo数据包数。 1 f( ~& j3 g' u6 C& \" x) I7 l2 x
# Q6 b1 z. H; R2 r1 P! u
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
8 d7 g7 T a8 p1 D; u6 i% A
# J0 p) B$ B. ]& J$ U C:\>ping -n 50 202.103.96.68
( a9 K. ^9 U7 T9 ]/ ?; W( L
. D/ y2 J) m0 ^- V Pinging 202.103.96.68 with 32 bytes of data: 7 u* ?+ Z4 p2 G
, n+ Q. Q( e, Z( `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 P' E1 g2 ` S1 \0 C/ z# D/ K! f1 V- _" g
* r$ h" }. _; G- k Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 - v& y0 C- R7 j }' A) u
9 z- Q+ a& X& V g2 C Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
0 f% F6 ]' ~# r( y; p; } 8 O% h2 G/ X7 ~- a
Request timed out. ) C: J5 ^1 q3 D8 c
; i) M- N- o9 k, U5 | ………………
7 B6 S* ^+ M: p& x& ?2 R 2 s4 o1 [; A' u# j
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 , k( F0 j- H0 d# [% l% f0 [" i
. J. @ x# X8 Z* V# x8 Z; F' c Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
1 H5 [" D4 Z; D8 W0 b" G " [1 I( F- w, l) U! r. D
Ping statistics for 202.103.96.68: 1 n& z$ M; W" n
" M; y* G% X8 F/ p- W T1 Q" ?
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: " S# `' w% {! q. q* b: r e" k
" q8 }; P% W' U! w Minimum = 40ms, Maximum = 51ms, Average = 46ms
_9 ?4 Y |+ H9 s; v
$ K2 H0 `: r& f0 h 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 % [7 j- r$ ]! c9 k# D8 E
( d8 s! P! ^6 |3 `2 ~" w/ |- S -l size Send buffer size. ; D4 q6 j" I9 [% U" a
6 U( P7 l0 y M6 D 定义echo数据包大小。 |
|