|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 ' P2 ?, _ A" Y H; _. q! J/ A
: e4 T; y% M2 a- V
现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
# `+ x/ }4 A! j& l8 o8 X! d / V: ~/ f9 ^+ d) W( i
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 # G$ H4 Z5 m0 `; n2 e
{1 a/ V4 [( V0 R" U4 d Options: 8 d# S9 q$ x# c" \1 n% u' _6 J
+ V) }. Y: W1 D' G -t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. / A v4 C: J# |$ n
' L% f$ Y$ H' P `% Z K. _4 e6 l
不停的ping地方主机,直到你按下Control-C。
) C" E% O7 ~2 U3 R3 c, W8 }0 ?
* L! `3 L$ i; I) ? 此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 . U2 d" S4 L! S# V; h
3 r, n* r. j6 M: n* T3 Z' K
-a Resolve addresses to hostnames. % R5 u( g" P: \5 |* T3 U& s8 Z) ^
% v' I5 F- Y* d* Y/ h
解析计算机NetBios名。 . n, H- t) X% Y' ?0 W9 x
% Y) x: T# g0 ~& Q
示例:C:\>ping -a 192.168.1.21
3 s+ I: j, L6 T
. t$ v7 L6 N1 @9 t& n* C% X Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data: : Q R/ [: a# [4 V; G+ J% G; A2 }6 `
2 W& A5 b( x8 Q" o* U+ _. W3 B# U
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ' o0 R. g5 q2 _7 J
. X6 }& W. @' j- M1 a
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
& ~0 u2 Z2 y' D. A# ~ 5 J8 l# O3 y$ t, l& h' B
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
9 a2 W- P( a% d: z( p. E& {- l" v% Q; m( F: z
$ V1 W" l0 b5 M; G+ S" A Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 * J8 M3 L5 o* _: f
9 V$ D+ D* D/ h Ping statistics for 192.168.1.21: 3 s: P: Y1 D+ g( {
! `! d9 D& y1 f* _
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
8 t4 i/ f [5 y$ R" b ! Y- L B; [; K1 P8 X! b) m
Minimum = 0ms, Maximum = 0ms, Average = 0ms
! W1 w p, a3 q $ {$ x" o' f3 V6 e# I4 _& S
从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 0 p( T" ~- g B, m
7 c5 ?1 i+ H; a) t -n count Number of echo requests to send. 1 h* b1 T, e8 U0 O8 u& n( N$ }* U
: E# r3 R8 A: ` e. S/ q( ~ 发送count指定的Echo数据包数。
. Z m" y: z5 d/ `
' ~: V* n0 M- _6 R4 M2 Y% o 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: 4 [6 S6 X \' c. S4 ^+ {
' S6 s0 ~. s3 w# X8 x, o
C:\>ping -n 50 202.103.96.68 0 H5 c% I# t5 i
& p$ H, T6 o. i- D5 K- c Pinging 202.103.96.68 with 32 bytes of data: # X: K- \6 V x* s1 X% z
* |. e4 a8 H9 Z1 u& L8 M, s Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
2 e: D A5 s2 B1 S
6 f; {: g2 v E4 {6 U% A Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 6 o( J* s5 U2 E9 u
' P6 x% {9 J( e2 g4 [& j# K$ ` Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 0 n0 h& \/ x: m2 j4 M
" s( R9 q& x. c3 i2 i( c. X/ o. J Request timed out.
3 t! J' S0 |9 [5 G
. C+ Q1 _/ ?# c/ m ………………
% W0 m# J/ L+ ?: o |" u% G7 y" O; V% _
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
* p t( k# e; Y. j5 x4 @ i % `- d! A7 H8 d- m; ]8 R- p
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 % [& o, C6 W6 B! N( N' {3 {& [, E5 g) R1 m
( v( s* D2 ~# h( N5 R( ^5 n! d, j- V Ping statistics for 202.103.96.68:
6 T( C( Y. s( g6 d! K % |! ?7 X" E6 e5 S1 v
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: # Z {5 N9 U1 u' O; w- V; G( [
* ^$ g3 e- }$ H0 y( G# E/ L* i
Minimum = 40ms, Maximum = 51ms, Average = 46ms
: `1 r/ L7 _8 t7 j$ `3 r9 Z
, O4 ?+ X4 N; W 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
& u `% \1 f% d, k! U0 V , `3 C. I" R2 y% [
-l size Send buffer size. 9 h, f$ y2 n$ T( c6 I2 j5 I0 g
( ^6 p* k9 }% d( P7 H5 c/ z 定义echo数据包大小。 |
|