|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
0 |/ {' v5 I* Q" L3 s
T/ f# o+ _$ p0 ^$ B 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: ' e# s0 J) Z7 l7 E' `/ h+ r
* ^7 X. b0 M* a# h, F
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
0 I% m) ]( V" N/ ]1 I; [ / i# p' `: K3 [( f
Options:
) K/ p) f+ X& ^ e# V7 p
+ r( j7 g: |$ c- a' u1 r% D% [7 T& z/ t -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. 5 {: `0 B% z: o. L: S
" V; h: ~* z; i0 f0 Q: X- H/ k. S% N 不停的ping地方主机,直到你按下Control-C。 % p. S/ e, S7 u( w+ U& [
/ k8 _0 h1 H) x# V8 Z# ^
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
- d1 [0 j* D. w) F$ ~* L6 y
5 f$ _7 j0 Y. S -a Resolve addresses to hostnames. 8 H2 O7 D+ \( ~
1 f+ B4 U* A' L! ^7 @, ?9 _' k0 N
解析计算机NetBios名。 / O, u$ n; _/ n
% B5 v! [3 t' @2 T. n( a/ h1 Q
示例:C:\>ping -a 192.168.1.21
; ?+ k+ y: u3 w5 r1 Y
, t" J; `' t6 Z5 c" E- T Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
5 s) ^6 P2 J+ \) t, W
' i* w* {. S( v' m3 x) p0 n, p1 Z Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ; A j% \! H, U- J1 Z5 e0 J8 D$ a
1 x4 X7 i9 G$ X: A8 w
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' o5 }: Q$ a" X* ]
) E' t1 |2 \1 r" w- t5 ]) @! { Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
+ V7 y8 z1 Q6 V3 ]+ z( y$ B7 f/ Z- H( p
7 A) _: U6 b* L5 u5 O" |: P6 X Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
: p% J) r$ W; `- ~% g % U) `1 l! M( x/ n* D4 i- ]' h
Ping statistics for 192.168.1.21: 5 y; A+ G* i6 {+ u% m
1 K- b( ?* ^2 v+ S0 q
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds: , s8 Z* H' Q6 ]: y5 E
6 b7 ~6 P2 |% @+ w6 _% s8 C Minimum = 0ms, Maximum = 0ms, Average = 0ms
; ]2 x, e' U( n2 ]/ m6 b8 u
* e: i. S0 |8 T9 n" K 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 1 J3 X& [) v+ x9 W | X6 E/ w
8 O$ Y- ]9 z2 m/ Q -n count Number of echo requests to send.
( C B, d, `9 g8 y; ^- x. D) F
$ e: ], W! O* L% L 发送count指定的Echo数据包数。
* q5 y6 O3 W0 j! T# U- R. a
+ j/ g! I1 ]* [- j6 U# O9 _ 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ; }9 V8 _) I$ J/ j8 R ]
$ L; m% I2 v" L/ U C:\>ping -n 50 202.103.96.68 9 N3 |* e% C6 a9 x Q
+ S7 X- n" D) g6 ^
Pinging 202.103.96.68 with 32 bytes of data:
- K4 \% K$ l& v, K- m. Z: |3 j 9 g' u$ W+ _8 r! n3 n
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % U& ~# c* J1 S" ~
/ t3 G; |# _9 R3 H Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 n8 o9 c" x. \9 R5 d9 ]) |! S
$ S% r& C7 m: V6 |7 }
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 . ^9 P$ \& ^7 W' _1 |( t
' \+ @' d K- i7 z Request timed out.
8 K! f a; }1 D6 C + V/ n; t; u5 K4 j5 F7 u% A& v
………………
: L: D6 P" e5 X ' u. d9 L" t' a, x
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 / @; h( G; U: H2 P
7 M/ o O. N4 `6 N Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 9 R2 ^1 r8 y3 c5 I/ ]( E" v2 B
0 w% v' F9 T4 w1 ~9 c. b
Ping statistics for 202.103.96.68:
$ |8 w: {4 M) X2 d2 ^% H + ?3 T$ U" d7 L! c/ E( ~
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: ) Y, L2 z& L$ A) ?
" F) E- O. c, C Minimum = 40ms, Maximum = 51ms, Average = 46ms - S1 K, Q* B6 }5 x
4 \; M. Z6 T3 R- _- [4 b
从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 & B& H S5 x' c1 r2 y
+ O5 F5 W! o% ^9 {" n
-l size Send buffer size.
; U- O& [" \' D! F7 m
l3 Z5 L' A3 E" m4 i+ H 定义echo数据包大小。 |
|