|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
$ l) q+ @% {" @& D g, P
0 \: O ^6 f& c: L 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 4 F- y+ z3 e3 \9 Q9 c- F
: ^* H6 l4 y. H0 e2 c# ^ 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
, w" l* K: k5 M9 [! N& Z' R 8 S0 j6 Y# x* t* e, C7 l/ i" U
Options: $ H3 W+ ~0 }$ q
, L3 a, X A* m% p i5 T
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. % f1 n% R# F4 j' z6 j9 V; \. b0 r2 L- t
8 T3 W+ U* t' G5 x, y2 q
不停的ping地方主机,直到你按下Control-C。
1 F. @9 A5 G- b& ^% T; f- R $ K1 b* |( Q( e4 m' w
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 6 m" I0 c4 _. F( T
8 ^ J" x) D/ f
-a Resolve addresses to hostnames.
. w9 Z/ B4 ~7 f' P# \6 Z2 i$ @
4 h" z8 E k( O' T" O 解析计算机NetBios名。
4 x. N4 X& ^) W& a% A) X
) c( V0 S! B0 \& M4 o/ o3 U 示例:C:\>ping -a 192.168.1.21 * Z" u% h8 a# {$ v- c
! i/ g8 z# ?% }! D
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: / `* `; U* a" q6 }0 P. F
& l) J4 w! {9 A6 w# M4 h9 e& `
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 # A7 s+ N0 n1 G t/ j& _
8 A& E+ s0 U( A' ]# ]5 D3 @" o
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ M9 f+ k# I- B, }3 j" s3 q 3 W- J" k0 K/ W- u0 _9 j
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ! i) I3 u2 V, ?( V
/ d5 r2 m5 r: A6 `
" R N0 h5 a. G) [" c
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 ^9 w( E2 M3 `0 r 2 Y% D" m6 B4 H8 T7 d% l) l' {: E- H
Ping statistics for 192.168.1.21:
3 r1 h/ K& j+ ^7 B8 F / Q4 f6 K' |1 c: m: T
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
: O+ _; b( s. Z" Q4 I ( f L0 j3 E* p# W2 I
Minimum = 0ms, Maximum = 0ms, Average = 0ms % s* O! ^7 B, t2 R
8 z' p7 d! i8 R0 Q2 n
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
7 W% L8 m# k3 d" V3 I
" D# E9 {$ X. e8 \2 o -n count Number of echo requests to send.
2 {( S' v6 r1 j5 ?7 F # m; U* H' y7 K$ l
发送count指定的Echo数据包数。
% E" P; i3 j/ {# ~
$ z1 |( R- o o# h3 Z; P* B, b. c 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
1 _' A# k1 c$ B
4 u+ E( ]9 d" G' a* ? C:\>ping -n 50 202.103.96.68 . T# `$ C+ H; M3 |
- h; K2 }" ~, B/ i Pinging 202.103.96.68 with 32 bytes of data: $ A, p+ q$ b3 m
) w. U" I! X4 O2 X Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 5 Q; m5 d, H. L; ]. H) N( B
# B% o/ A3 ?# B
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 P. e$ j: a- V0 @9 Y
: E1 f& g% ^) y7 P Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ( E) L7 s3 S3 K' g
8 \; }# S3 ]" [6 ?! k% s
Request timed out.
5 {" ~3 P3 p- S
, S" Q/ L/ H& B5 q F2 n; a ……………… : A& Q( u8 F6 n9 L% G
( i3 u4 i8 E$ y! {7 t
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" g1 s3 t6 b5 s4 l
$ T9 L4 P" D1 X/ Q; _ n) F: n Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
4 W! y0 T- d$ s5 ~ / |' ^2 V, a# O" C: M3 b
Ping statistics for 202.103.96.68: - s' g& }0 @9 G( n ~% y& u
& n, A6 Y. E5 W, t" h* c Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ) w. u6 \7 W' s7 }
( F2 l3 g$ F+ \% X0 ^3 n* [& T Minimum = 40ms, Maximum = 51ms, Average = 46ms % p2 p9 g. i1 x/ X- ^' T
# k% l& V: a6 w 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- e: ?* ^! z* x: `$ y
( G: v1 m+ ]7 D" b -l size Send buffer size.
* I- f% x+ v( ^" {7 p
- C- c d- M4 H" T 定义echo数据包大小。 |
|