|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 : h7 ^- A+ {8 y
0 x. E0 s$ O* o8 q" M! C
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
& [$ H- h4 @) m' G+ C
, ~: H5 z, q8 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 7 L, K g" }4 K0 o4 i3 o
' U% N) e, v& r/ y; h3 d' J% W4 P Options: 4 X. J! u& }6 A* i! h3 Y1 Z% q; L
. h7 t6 S# h' c3 _ -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
1 p* c5 W! A( P( Y( p! Z # I. c: J* e- X
不停的ping地方主机,直到你按下Control-C。 9 W. P. U* O( J9 D6 K! o6 Y' E" S
, E) c- h7 a' a1 M* |1 `
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
) J0 Z/ ? v( d) P + }$ j" m- R) l9 t$ S1 g4 J( ]& ^( H
-a Resolve addresses to hostnames. : c5 X* B4 r& H _
; ~& |& P- ~) L/ X' L 解析计算机NetBios名。 & Q+ s1 t- q( }# W$ M0 O* @, x
1 x! [& u/ Z" e" u% L# R, d
示例:C:\>ping -a 192.168.1.21 % w/ s! _+ H! e. F
( d6 r: A4 q+ x. `9 M ]; Z. b Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : R7 V m7 m1 N
) N( E% B1 N( t. {/ J; j Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
6 Z4 p0 Y/ t) |& f3 ^ q! F/ H
1 V ]+ u6 @5 E6 `1 H# u0 `3 Y2 L4 R Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : \3 V3 ~. _( G; M
2 r1 k0 j# g) r Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
q4 b* V/ D3 a% _; f: J) V4 h M$ m: G9 B- b4 M' h' B! y
% e j" C$ b ?
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 : C4 f: g# R, q1 y: L$ H/ l
& e# d5 S: `* k5 G6 P, A; ] Ping statistics for 192.168.1.21: 7 C, W5 K0 r- E w9 x0 N
7 `1 u* m {6 l, ?, W Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
! Z7 D% S1 E, z ^0 |9 u
' |7 `) I' o' E- {% J+ E \ Minimum = 0ms, Maximum = 0ms, Average = 0ms
% i& X) ?5 y2 l8 l 7 L* u) I l8 O8 P& D8 D9 M
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
8 \1 ^# `+ K# y% s) n. {+ ^/ s 6 e" C4 J$ ?- H6 i
-n count Number of echo requests to send.
0 k" q3 g' c0 j; T3 f6 ^
2 x/ Y% d. U. v8 Z u, b, x 发送count指定的Echo数据包数。 : Y( r0 ]- d( q; u% ~: D
7 X; n O) \9 s 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ( Q1 \6 ], o* }# h; _7 L+ T
3 U- {: }: G% k) L# X, ~
C:\>ping -n 50 202.103.96.68 * R4 e. g% |9 t E1 ~: B( d
$ Z2 o7 B) c+ o" G8 u/ H Pinging 202.103.96.68 with 32 bytes of data: ) [* T/ C4 U, X* M+ C5 `0 v" J4 J
# G2 i" r g7 r5 H1 b Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* k" ^+ d% K# H% {7 @7 g; P
2 Q" O) u, N3 M m1 F& `6 z/ c Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; h7 M1 ~; |; g2 n 2 @" {/ U7 l$ p9 d. L& `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 s- u$ T6 {9 W$ ` 5 @' k; I2 k- \5 W# k* l# L$ G
Request timed out. ! L8 p1 V7 _1 o: i( y
, s; A. w; G' O8 q: {5 z ………………
+ f& X+ ]5 ?- }% {% B6 b$ V+ l+ S
: J# c: j) P3 w, M* m Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ' M- l7 }* N y% q# ^( ~
1 Q3 {) z2 \% \# z
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 D2 C8 p2 R; r2 w
0 H @5 y4 r& Q( H6 d- L/ e' |5 m Ping statistics for 202.103.96.68: 9 s: V; r/ b. _: q
* e0 f# t; I& v& p0 o% }* ^ Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
9 j6 ]7 Y8 @$ Q' W3 Y6 T
2 H$ Q9 P: w1 L1 Z) s3 _5 Z' T Minimum = 40ms, Maximum = 51ms, Average = 46ms
: c' ~& T# [) u- S( d7 w
6 \: {6 J" T0 C 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
* W' Z. q+ z4 l& o5 Q
8 a0 u6 i" D2 n/ Y G -l size Send buffer size.
+ _' b+ f0 E. P# G
- @4 j$ a: K. A: F) l8 x: X/ W( h% e- p 定义echo数据包大小。 |
|