|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 5 O. C3 y& s7 l3 ^
" p7 c8 [8 L$ s( G8 _; L0 O
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
2 H! N2 t* V' e u& i
c9 ^5 n8 c" q0 H" T$ q* y) L. d 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 2 _6 W ?9 R0 U! W' @$ u+ r3 s
* w1 c' X5 I& n- I" G
Options: ' N& \ }3 P" M* s
% f- D* {; Y7 n& o -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. ) W0 E: W3 q4 k L4 R
* D' D+ {7 Y# @) {4 Z9 n$ L
不停的ping地方主机,直到你按下Control-C。 ( i8 `8 q5 E% \
0 h/ A1 p9 o& O* m( ? 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
! }8 F3 A# C: ^2 k: Y $ g- @# E$ E0 f1 G3 ^6 j: x' k5 z
-a Resolve addresses to hostnames. ! m% G$ p' F2 n+ r7 S* |# J
& e; _7 g# e0 V+ |% X1 ]: z, T
解析计算机NetBios名。
& f w& Y$ G7 j ; X6 \( ^% U# L$ o& A; u
示例:C:\>ping -a 192.168.1.21 ( w6 L" d4 h0 W! _: o" [9 v
6 s% k! p; @& u( J7 Z Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
: F, Y }5 a/ T4 G' r7 P
+ F7 M$ i$ [1 C- {' d& ~0 g. A Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& z. O& ]4 V! D2 X7 v( K7 R 5 w6 D, x4 ?' [5 @. D4 Y9 a* @
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 & l8 ]! c3 [- b% N) h) o* { r U
" l4 I. q% M. t
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 g( `. Z0 k. }4 x- L0 B. c$ b1 E9 Y
' z$ b# u5 f& L* i: a* \2 ~ W' q, O# P5 @+ ~ O
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - ?& I; s$ B2 S* E5 S$ M
3 K4 k9 l; i$ h7 M4 j: |8 Y
Ping statistics for 192.168.1.21: / h- }+ x T6 G+ K6 A8 P) U
' S5 T- q! N* O* f% [$ E
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: ; q6 }2 d% I: G/ ~
6 c1 C& c, ^& o$ k" }/ R
Minimum = 0ms, Maximum = 0ms, Average = 0ms
0 {& D4 W2 Q* p. `
& ^' G i. l$ s. v( f8 T' W 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
$ w" \, @1 D! i
% }1 x' `' n% ^' J -n count Number of echo requests to send.
. L4 h/ ]" i- O' Y* r
4 c/ h/ [+ z$ `0 e) L$ l6 S; i 发送count指定的Echo数据包数。
H: i9 R- b* {2 r7 X- B 0 j( \# I. F4 Q8 Z% P
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知:
$ s' R5 ]/ {( G) u 2 b# U& f2 q6 n& N( Y
C:\>ping -n 50 202.103.96.68 # M' q* U0 o$ K
. q9 f; ^5 I+ b7 g! J% R7 I/ o' k
Pinging 202.103.96.68 with 32 bytes of data: ( R! Q, R" q u# k' Y1 i! W
" }( p9 }% n9 y# V
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 F2 p2 n* u7 ^6 z3 I- W6 f
) h+ K7 a; X, T( y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 : p6 V6 Q* Z' R% T/ y9 i9 G
% I( d& X9 ~/ q5 @4 n$ v Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
6 U, \6 x, A: h. d
L. [/ r& ?$ j4 H Request timed out.
# V5 T% Q P) T1 y2 s$ P/ T
0 a( r% { b6 t& |- |/ [3 s ………………
( r* I# B L* ~/ [( `# ]- y. c+ `2 k
" {1 F) x, A3 S2 x Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % e/ K; n3 w' b9 I* k9 u. F; P6 R
/ J0 e0 d4 P& v9 B* [ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 3 l) F' n5 y5 V& Z+ ?! \
) y0 d7 n3 R0 n
Ping statistics for 202.103.96.68:
/ L+ y& N% v4 o
! ]" p- ~3 z- V( Q5 u* I5 l2 O7 h Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
+ g' j: j2 A* W$ Y+ A0 @1 c! E6 K 0 b8 ?/ x7 m+ M' a2 l) ^) H
Minimum = 40ms, Maximum = 51ms, Average = 46ms
" \) m+ O B h
( q* `. s6 ~8 u: L 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
- x9 P* Y, L# d4 S/ K: o 6 B1 O; n$ Z! y5 E- ~. r7 O
-l size Send buffer size. % y! Z3 X* T; J$ j* E$ I
" b6 I8 u' b$ ?4 L8 Q; V4 h
定义echo数据包大小。 |
|