|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 * H6 U. X+ a, b4 F1 T% F: G
1 ]9 @& l0 M# ], o6 d! l( Y/ h
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
( S+ s. y& z2 N! ~
0 o3 N5 J& s0 o0 `# A8 |2 G6 a2 v 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 . \& ~/ G7 q; B0 S0 D
9 e( K/ k) X( j3 C Options:
) |: C& \7 @8 Q( { N, e1 W9 E0 J
4 d) {* n) U* s9 q+ C$ ?2 u -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. / n: u. E! d9 I& k& V& y' [8 w- W- Z
# ?7 j% R* t4 j7 C 不停的ping地方主机,直到你按下Control-C。 : j+ D! t( \) @, ]) g
& m: p7 R h; f5 o0 E. b
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 + k! u" z" I6 D: A2 K
9 d; k# @& E. e, c
-a Resolve addresses to hostnames. % d9 j6 e e% O# e& s1 Y8 I- e1 `
6 q* o& P1 X- W7 _" t
解析计算机NetBios名。 1 S, ^ h" d, E! W
1 m" E0 d( e3 Y8 w0 @& V( ^ 示例:C:\>ping -a 192.168.1.21 0 i @: f Y8 Q6 ]
- C* |0 p! e/ c5 B* o Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
0 n+ p1 E" _5 Q2 Y" a8 e, a: m
, k- z- y, M. y8 V5 T Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" ^) ^* P4 H, D' V D
& S0 _# X2 n- g Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
" F8 [* E6 d) e
. f d/ h. z6 Z2 L Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
8 S+ u! b: l# q8 i5 E8 q
" `. {6 X3 b' z+ b 1 \0 A" F7 c$ t2 k" m3 \2 ^( \# c- I
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' E/ |7 W; n/ k- f ^
( D7 ^/ i2 _* N8 {4 x1 C6 V8 E- | Ping statistics for 192.168.1.21:
& D6 K2 q9 Q# `0 S% l ]9 V4 p ' }4 T6 ?6 F5 n
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
; a2 C6 c, u- W) s' T7 i ; n) V8 P% P4 L$ j/ ~# w
Minimum = 0ms, Maximum = 0ms, Average = 0ms , |. Z Q3 o! F9 i$ R
# ?# q3 a& F/ V7 d+ T4 l
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
! W% ~) e* A+ m
% ?- D1 u* \/ |3 X; M -n count Number of echo requests to send.
' m F! u) c" w& ~
7 \0 v- B1 D9 w1 C* v, K2 c8 e 发送count指定的Echo数据包数。
/ t% }$ {3 r+ S. }. c& N
! M: x2 H( K4 C0 m3 |- v- b3 P 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: * w* o$ [1 B* b$ u: V
$ a7 J) G- P6 U" M- m C:\>ping -n 50 202.103.96.68
' _; ^6 T" U+ V+ e1 s: C+ j9 v - r3 e% |% ?; e) J ?2 p
Pinging 202.103.96.68 with 32 bytes of data:
8 U! P5 |& ~2 A( p* _5 t6 t3 w8 n1 S# a! Q
3 G6 U: a" F( R& M6 g2 K. @ Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( W- t% y }$ J- Y6 H0 G0 M% |* o$ | . F6 G6 c1 G' h/ j! l4 U3 \
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
" Q5 r$ Q! @& S. I) V4 |* {8 w1 i 4 j. M' L) F: u& b6 h9 j
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; d( `1 V1 @, o* s+ Y0 a / c5 G8 u7 a* w% S
Request timed out.
p# S+ ]- R7 [$ j * [1 L0 N5 @. d1 ^
……………… ( \5 G- Q1 ^4 y) e
$ u/ Z) E; H1 r; i$ }: C! N Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
$ z8 X- H @! l2 _/ | 6 i4 w8 a% s- s6 d& f1 n( T+ w: b
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 Y& I/ T: D5 N3 e
3 B% r. L" i2 x1 B' O
Ping statistics for 202.103.96.68:
7 ^3 w D3 v: Y 0 k/ q; A. O+ e' L
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 0 M# P |' x! p) b0 e
, l2 s5 X; s. r+ K, ?1 q
Minimum = 40ms, Maximum = 51ms, Average = 46ms 9 m2 Y$ E, L$ X2 v
9 n$ N" Q$ r# C& ?$ z7 K+ `
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 & f0 F6 E/ {3 u, B# r, G
7 s0 Y8 ~4 f' X4 \+ l6 j0 |8 K
-l size Send buffer size.
: X' q% @: w4 t: K' M, V" Q: W / c1 {( b8 g# @& l2 a- B+ y- k* R
定义echo数据包大小。 |
|