对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ! a S( C% S" Q/ ^) ]1 F
- c% I5 I" H7 `$ n( Q* a2 Y 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 6 p$ _) a, B8 W- j. t m
+ E4 V: I. J' a+ D" c+ B
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 3 t B- D! e8 t+ ]6 n7 t' B
7 u6 X) _ k( }. c4 J& `
Options: 0 U6 j% [4 Q7 V/ i / A5 g9 ?5 r( G* d1 F2 q7 A -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 7 v' N4 Q: U x
7 \* }0 u0 N* Q* N 不停的ping地方主机,直到你按下Control-C。 * r$ q+ c5 W" \4 p0 W
1 A0 t; h- k( O/ _
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * m" F! q! F# M' S) s5 i 5 a0 F7 o1 \7 B! _7 [
-a Resolve addresses to hostnames. 8 |3 |) Y! r) c6 R# ~! q- D7 ?6 g & F& a1 O7 l5 W% I# a2 g h" u
解析计算机NetBios名。 + r) t/ j. r- \9 O! q
* Z3 y' i* _: d3 v- J. U, m- Q
示例:C:\>ping -a 192.168.1.21 8 T0 b6 L$ f' n/ u - k8 ^" @, _- I" y0 @& v( v
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: 7 D0 ^1 o2 K2 E5 F2 }& l) I- c
1 Q' P3 }2 {* o o1 G& e
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + E! a; U) `, H* @" w; E7 Y ( p+ E( n' Y3 }% D0 E4 u! n. x
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 7 G) B0 F, E/ k$ g; _$ e5 P* F
2 G+ B/ M( y5 `1 s* o7 ^5 w4 h Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( u* o; j" c! a h3 m( f% K. ^3 K
: s- u) D/ A8 S0 N) y# L1 e 6 u- J- h8 [; X: E. j# k
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 D/ p! U0 o. \6 h9 Q8 K; z. s . E! v. c E+ d! P7 Z; I2 {" V
Ping statistics for 192.168.1.21: ( z& z/ S, m P! I1 S( m: G% K
; T* r2 U P# ^$ V Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 5 X; p+ f2 Z# r( F" l
# K: w- u# e1 h2 |0 O* [- h% V Minimum = 0ms, Maximum = 0ms, Average = 0ms ) E. _6 |; B% {' G 8 w0 Q9 X5 n* u9 D, [8 H 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ( I, u* ^0 w; A( l1 o; V! f
: T# \( {: r' t, j" E
-n count Number of echo requests to send. 5 a$ h2 C1 M* L" M3 _5 R3 b- w$ @ # M6 }5 r9 Q5 b% G6 P/ [ 发送count指定的Echo数据包数。 / U& L. U6 D7 f, w6 e0 r