|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ; S5 I6 x; Z$ t4 y
; Y' J4 C4 u& u$ V7 Z 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
2 C5 C, T: L0 q " E l( x/ e) f' R
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
5 X2 _2 }7 L# t
- b6 e, L6 c2 O9 |+ `) \$ \0 }4 y Options:
7 R+ m2 n' l |/ I / i; O7 l0 ^* o- }5 `2 |
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
% \# x X5 R7 I o
O0 U0 ~2 B; s* K# L5 } 不停的ping地方主机,直到你按下Control-C。
( \3 I- n$ v( Y, E7 P 9 u7 L6 ^ l* D- h
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 & x q/ N1 `" K T
3 @& T0 h4 C7 [; \) K0 o
-a Resolve addresses to hostnames. . ~0 G' t$ H. Q
" L, F Y! R" W" `- d3 h 解析计算机NetBios名。 / ^1 c/ H$ v* Z6 P" E
[, t4 a% r! U6 l 示例:C:\>ping -a 192.168.1.21 ( w* p8 ]8 K/ j& m9 }2 q/ E& }5 r- d8 H: P
% c" A& ?/ ] ?( Q0 E Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
+ @- b3 V" B @/ w9 U3 ~; b0 V / T W. t8 ^0 |) P3 j' F
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
. a9 V) y) b5 `
2 i7 g- N# u# I* m, L" t Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . P' A- Z8 M( T4 x& Y. h
& U5 g) s4 o5 b3 Z
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 3 _2 {9 x) o4 X! C
' ~* T* l8 ~; l' v, K " X" R$ X4 v) [5 d
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
! G H! p& l9 d P+ `1 q3 K& e 5 }+ g0 ?3 g3 a4 g2 I) S
Ping statistics for 192.168.1.21: 8 ~+ o2 _- N% |; o' Y
0 G+ i; A' J% v! a* O
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: , w+ _6 ^5 r$ v) ~: Z
+ z* @& C! R7 M# I$ \ Minimum = 0ms, Maximum = 0ms, Average = 0ms
4 D' l9 H9 w3 V# X/ b3 z
* S5 f3 t2 Y' w/ F- K1 s2 h" E 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
7 C0 f( X t! F) q) i
s5 U" _5 s. L7 h1 Y -n count Number of echo requests to send.
" L: O! K* Q: f * H5 t" c) B" v$ ?) v
发送count指定的Echo数据包数。 + x- c/ B. N8 q# R
8 Z- m# H2 P. I- F- v
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
9 c7 ?' n' }+ C. P% B5 K 5 a- ^7 v5 k0 m8 t6 \2 Z: D
C:\>ping -n 50 202.103.96.68
/ K6 a: m: d1 \) a0 r 4 j" {' A" j* T/ n! b% z
Pinging 202.103.96.68 with 32 bytes of data: ) |+ ~1 \( O! \/ @' U9 l
. B! }6 F- [) v$ q8 _+ Y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
+ {% Q1 ?2 z/ d5 j( u5 o 9 ?/ P! K2 b6 C( d+ }
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
! h, I0 w6 |9 s9 l3 `! [ 6 P1 p1 b1 ]9 k+ {3 x# `
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 s! }/ T* a# F1 N/ X 6 g$ c. U" P8 Q; n
Request timed out. 3 E4 }3 F3 v/ i% K u
* Y* Y( I9 `3 W* L( i) x, Z2 ] ………………
: w* z& p% j2 T9 d7 ^- T# K7 m
+ k3 ]! V- D3 g2 M* r( I/ u Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 T0 M6 t4 s! L9 I. V2 P* U8 O( q : y$ H0 y+ m, A7 I# J" L: M2 D3 g* V
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) e/ ]# c, K7 J- v8 i0 c
1 r' L3 |0 N, r- k) y
Ping statistics for 202.103.96.68:
: S/ c9 u% B* v" s, o0 T# L 0 t$ |7 S* a, H% q% w; b
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
8 S+ a; l! @: M4 e2 s- }; E0 T1 A0 _
u- a& R# d/ w: Y# }8 W Minimum = 40ms, Maximum = 51ms, Average = 46ms . [! D1 B! u/ Z: l! |9 d4 U9 e
0 V) y. B, d/ z 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
9 w: v8 |: W0 W ( r4 g7 T4 P! P2 _3 I3 b
-l size Send buffer size. 0 D9 i( `. ^4 j1 D0 ?" g1 j
$ L; ^/ [' t4 R( D( d6 f
定义echo数据包大小。 |
|