|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
: ?# q# p5 ?* e+ Y t3 c) b' N
_: Z \/ ]# r3 [! z 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
+ ?3 D. Q: Q' G" T/ w/ R/ S9 N
/ i; z& `' O# M b- M+ 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 2 |0 b1 o. V/ \
& ]% Z! w3 l2 k9 a7 M$ g
Options: ' i, B' [; |( x
7 i3 i3 f3 B6 ]; p2 \- _. T" c& ^
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
5 ~; F' }8 Z1 b) p0 R& ^$ L % y/ F0 H D# P. y; ]' |
不停的ping地方主机,直到你按下Control-C。
2 @, a" B5 E. e
& Z% @- p- H E 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 1 ~# u- n- T. n# H* `2 C2 C! c
9 y+ B: T! g, Q -a Resolve addresses to hostnames.
& U y: _/ b, C! {, i
$ p% D# b$ r8 X" a& A1 J) \ 解析计算机NetBios名。 4 I8 n5 T$ n7 j% S. Z: ~0 s6 L# A; w
7 U- V+ V9 D) i% b2 f' p 示例:C:\>ping -a 192.168.1.21
* D) {. S; y! w+ l" N7 A3 r S% `7 \0 @: U( z, e# q5 E
Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: . r+ b6 Z! I. a9 f! J1 j
* p+ T2 g: ~8 B7 R- Z
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 9 f/ B, Y4 }* u
- C' B R; o. e( \5 F) J* e* ?- x; r Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 ~9 l9 `* @. _- G+ N& R
/ ?: K8 Q+ R: F/ x6 `
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 6 g% H2 O* n) B& @* e3 t
, L5 i, J! D8 @4 o8 D7 w5 t
# [- h/ @ @( n* O$ @9 q/ Y Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % K6 A n$ V+ p+ b: n
% a. u% `6 L1 ]) H0 t
Ping statistics for 192.168.1.21: : X1 e3 X; ]! O; E) P0 e; Z
) K) A$ g! t" J% M, S) c4 S; R& R! S Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
3 B) d3 R4 I5 c2 u ] v% {/ R
5 F% K" Y. M1 @& z1 p+ E Minimum = 0ms, Maximum = 0ms, Average = 0ms
- Q$ l P* J( D$ k, q 4 [! S8 ^: l( h
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 ; \% ?9 t: H7 F0 d e/ ]/ M, _0 f
# j% p: w) Z2 I8 O
-n count Number of echo requests to send. - f' |/ w/ p9 l
+ M: G# p' ^' `; l! H8 s- N9 G& ~ 发送count指定的Echo数据包数。
% i7 e7 m+ ^5 K9 j
/ q1 f% a$ m2 g# [! b9 n4 x 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: . T6 Y4 ]$ a# t' ]* \1 d& m/ q
4 ^, d! e* W7 ]8 f, y8 c0 d C:\>ping -n 50 202.103.96.68 * @: r' L& J% ]7 u2 v! O
% r3 j% I2 g, x+ d$ b9 v% O! a
Pinging 202.103.96.68 with 32 bytes of data: ' p# p- {: z1 t0 R$ w) ?$ m
7 G i# S# C. X% y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( g \5 H; T" Q3 f - C# |4 a' ]) r5 y
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % r7 K7 P1 ^- |' p' L7 y" |
9 d/ _4 X% [: ?% T! Y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
5 ]/ g5 D+ }. D0 N
3 p. D8 I9 b; y6 L0 z- R Request timed out.
* Y% l1 I' K% l# _# o, a) r 6 P r, A: K; U' ]7 @
……………… . s1 v: Q' M* U/ `' D
4 a% u( i0 a6 F9 M T, H( U
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 7 N* ?" m; L/ Q9 d" O; e* A
; h" R+ `3 \1 a Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
B T1 m/ P l6 z/ e. K " F4 M* F2 M' p
Ping statistics for 202.103.96.68: / ]2 j" i4 j; I
! @/ a9 | F6 ]9 E( [ Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
$ e) t+ E8 Q W9 o; l8 h4 ?4 Y0 _7 T9 @
, S+ n4 r3 S* o9 G- T Minimum = 40ms, Maximum = 51ms, Average = 46ms
2 k6 P7 `+ a. k9 W0 u4 M $ s' f& F1 [4 l' ]' }/ F
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
5 j& B% }4 M9 h+ O
" ]' _3 e' O8 L0 g -l size Send buffer size.
% y0 E4 N6 T. b7 b5 i6 e0 _ / u& u: h* B) _4 l& K7 ?7 U
定义echo数据包大小。 |
|