对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 - C6 K8 c+ \' D+ v0 D" z* H: o 7 r2 }, U, ^) r4 R; T. D 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: L3 s% o8 o! l3 f8 O, V 2 b: l J1 a! R z9 g* j. x
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 9 H( a1 x) f: h0 g. v. i) ?0 G 8 e. B6 c+ ?7 S/ j1 y5 o Options: , ]' D, w, A5 p0 y E3 e2 ^2 p
1 D) j9 }1 P8 ]/ v! n+ b2 A6 V
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 2 [" B: o* W- p9 J9 G) F; k/ h" l8 u # s, _. U% o- B. J3 ~* k4 t/ p
不停的ping地方主机,直到你按下Control-C。 # M1 M. ?- }* h3 V
3 W5 ]* k6 J$ n. r9 g% T 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 * m, O7 N9 W; I4 Q8 f7 J5 \
" g# ~3 Y2 w6 S! _! u- k$ H/ z; |
-a Resolve addresses to hostnames. 4 Q u3 |9 J/ p2 s( ?% a
/ P* u' @5 U: Q4 q+ ] 解析计算机NetBios名。 : Z- D. A6 z& a- M: r9 z " @9 `: K3 V5 o' d/ [1 U' Q 示例:C:\>ping -a 192.168.1.21 ; x2 h1 Q$ m% i, Y0 o * _ u1 R6 s F [ Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: - B6 E5 Z- T6 r# g4 K& Y5 Y 8 d4 k0 v; f$ o- E
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; W2 n0 G$ T6 j( J* A6 V3 Q & Y( t. q% x, [3 s. E6 W
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 - J9 B& ]/ g1 H | ; Y0 |0 {( h- \9 Y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 ~# w4 P' a, o1 o$ K
6 z! e1 ^ L/ t7 u) ~
, d& M/ c7 d" F% ^
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 / ?$ q& [6 E* h- d# R1 I
6 o+ S- S% m' `4 ?, h1 j Ping statistics for 192.168.1.21: 2 C' }. L: R. y6 z 0 `- K! n: I" I/ I
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 3 Z$ n& V; B5 N- N A* }
]% w2 D0 c9 h6 d* ~ Minimum = 0ms, Maximum = 0ms, Average = 0ms " P" {- ~& q- k0 W & x" v+ F9 R. l. v 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 8 u: x/ _1 ?+ }, K( o% `3 g 3 ?& V' c2 ]9 {
-n count Number of echo requests to send. ) X- y9 L: B1 e( ]" R $ f- d' O5 Q, ~& x/ C% Z/ ]5 d6 C# t
发送count指定的Echo数据包数。 ; C; ^, X Z: X# D! Z. s