|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 6 |. \9 i5 X( h3 R" a# s" {
' A+ S6 W! [/ q F. d& o4 x G, K$ o 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ' H, `( O Z& z& |8 L) P3 R
- n6 R" [/ U8 ^; x6 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
- T+ N+ A* B& h: S
2 h+ B. g5 h9 F7 d: }' i Options:
" G7 T: h8 `" z: @* g
: B* j" F! ~+ m- ? A" O& f -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
) F- `' |: `! f 2 ^% U# ^+ [! H! i$ m
不停的ping地方主机,直到你按下Control-C。 1 u( r. k! P1 H% k
' |" E* x! g$ h* @/ w) I& w* G" ? 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 ! s$ h3 y9 U+ c: ~0 K" r1 c% I/ w
8 ^6 u Q9 _# h* K4 j -a Resolve addresses to hostnames.
$ C7 C3 q: I3 o' L" C . R1 d+ r6 \9 g; @
解析计算机NetBios名。
1 k6 Z V. L* v6 V
0 j6 G- N. w4 R4 ]3 Z$ S6 o 示例:C:\>ping -a 192.168.1.21
% O3 d7 Y+ H* ~: ^6 W1 \4 u5 a 2 X& d7 f: x' V. q% B
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 \: I, F' \9 F2 h
/ R/ m( |& m" z: A Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 4 g0 H8 I2 B9 U$ J% P) _3 M% `
- ^4 a# H7 I6 L" z
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 2 s' k6 Y, m O1 i: Z- y, p
2 Q$ S, e+ v2 d, d6 q+ {$ t Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
4 F0 Y B# e: \1 S- {# J* e5 h+ o; i! b
5 M7 S5 R& k# V& m+ P0 U. [ Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 \& S3 ]. p( r1 g" C: x
, E) r+ o$ z" Z0 m8 x: J; D% @/ @5 [ Ping statistics for 192.168.1.21: ( t9 a2 k" C8 s
- |. d7 T: f Z. C: L Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: 2 X2 I6 q, F; E" y, N
$ x5 a% M5 } @ Minimum = 0ms, Maximum = 0ms, Average = 0ms % [! {5 C* X( s: M m
: Z1 x# r. u# \ V1 ` 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 : e( E, j6 |, X/ A7 [6 J' O' O
& M- _! q4 ]; n% L4 G' v7 h; c -n count Number of echo requests to send.
6 z% R# l5 N' f' |% P# n2 U; {: @3 e
0 r5 d6 g5 b4 i. j3 I w 发送count指定的Echo数据包数。 # u- e* t P, M b
7 o" M% H# t. G5 U
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 5 r, |8 _5 T2 _9 M5 Z6 c, Q
; I8 f' [! |0 T/ r. ]- V: \
C:\>ping -n 50 202.103.96.68
$ G7 T! m2 J: ^0 J: {) }" z5 S
& t, {7 O; `; O: d ^: E. g" l Pinging 202.103.96.68 with 32 bytes of data:
) f% m$ F, O( b% Y- L6 z # |: O: T+ k; \# ~9 m8 b
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
: a$ a0 l0 l! S; ^1 o( l R$ q , N- s! j" E# h
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
3 _8 o* K G3 Y" Z4 W; Y# R9 S4 u
! Q9 R( ]6 p0 w Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 M* O# Q3 a/ E3 c
2 V1 [$ j. `- e4 Z1 m/ G. s Request timed out.
" B$ y( h h: n/ Z6 Z7 M G0 ?
3 U2 C1 G: w9 D/ G f" `' @ ……………… ( d1 C; e. v9 p' r) w
8 b: [7 r& ?+ j& N
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" q: _7 `8 Q" e
0 G: P; _) b' ?3 P, b0 n$ ^5 k Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% Q. f6 M! P1 k7 r) q
4 f5 @" l, `6 f0 V Ping statistics for 202.103.96.68: % @9 @0 W; ]0 V" i( b% G5 H
z# c% k4 k+ }5 w- }! W
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
0 g( U' u9 a# g7 ` " Y' s1 i$ [. C) ~: ~: n' A0 a
Minimum = 40ms, Maximum = 51ms, Average = 46ms * {0 G1 z" u6 L' u1 g$ D
; f4 \5 w8 V( b 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
# y6 S+ T. b6 o. m0 ~$ S, T
N0 J3 p0 E- ? ]# g -l size Send buffer size.
$ j% v: e3 f2 l. B s2 C3 e 9 g- u# t$ u/ s" I
定义echo数据包大小。 |
|