|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。 $ z [# S; N- I! U, V9 u! k
- ]7 z5 O! l. w7 s; G. h 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用:
9 m7 Q5 P1 G! S* h8 e7 ~+ z$ a, B % B5 o1 J% e" j9 f* L+ q3 Z2 u
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
; N; t- f9 s) y X$ T 9 h8 M8 L/ q- F4 G+ U. r
Options:
+ S6 U. i1 j0 ~, T/ ~ b ' b, ?7 Y; f/ Z" N; H
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C.
- ~# N3 v0 E z( I% x& z& { + w* C- P' j# P6 X. f
不停的ping地方主机,直到你按下Control-C。
( m6 P( ]4 l# }( Z4 Y/ W2 ?( C 6 h" k: z0 P& B& g/ f u5 j
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。 $ M: X9 v' f7 n, N7 Q0 y
% X- g* `0 G& I! x/ q e- B5 x -a Resolve addresses to hostnames.
/ v j* u/ h8 V% K
6 X% S% y+ O# i: z' H# | 解析计算机NetBios名。 * o" J2 s4 D9 R9 M3 N \
1 U! ~: K/ O3 D6 m: w" M% f0 k 示例:C:\>ping -a 192.168.1.21 ) L2 s' z0 y, c& i/ Y# L
' D7 c+ P& W: V+ H [" g# J2 ? Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
9 L2 c: b9 S8 ]. i, } ( O0 H, @# v& F% l
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
) i- }9 t( w- R. r # ]( J- I8 @0 t9 L7 z _9 s
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
1 b+ d; ]; T9 z* A4 J% g0 ?6 L % _ `& X% l5 d
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 5 u# ]5 Z, O3 j8 }# s- n$ @ u7 A1 f5 r
) ]$ b1 Q$ u. i1 Z
4 L1 {7 B5 L! s( x$ n5 G9 Q
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 . X, x5 Z9 y+ R% f+ }# V) Z+ b3 g0 K
8 i6 r( F+ P& ~# I& h$ ? Ping statistics for 192.168.1.21:
% ~) j' T/ I7 ~" G3 X [, ?8 O8 Z 9 N3 z/ ] N" s6 ~
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
. r# g8 E) D4 M! {, E7 r
) g K( Z/ r( Y% x/ ]/ ?4 u Minimum = 0ms, Maximum = 0ms, Average = 0ms
/ r) r2 g/ `: N8 i- x& \) ^
: r/ m* U) S7 W: B 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。 , x8 q+ j. b6 i1 E* V6 |& \
- G: }" p6 D6 k3 E
-n count Number of echo requests to send.
* l2 ~" ]% [, Z7 }' u3 v" [
# b2 Z1 W, j" n& G" u8 H 发送count指定的Echo数据包数。
; b- O. \- B. T: z: U3 _5 z
. a0 a. t q# ]+ P! k9 I! N- X. C 在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: , ]6 Q: h* d( R1 W" s c' {
. @* U9 @5 n; s
C:\>ping -n 50 202.103.96.68
: [6 ~3 _4 q% m , }6 |; k( t- K: f9 ]3 y; a
Pinging 202.103.96.68 with 32 bytes of data:
2 f, y% }, d6 x* i( k 7 s& n$ r) R+ M% F5 X1 {, W0 k& x2 u
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; S6 Q* |: F! E+ A$ v
, X8 Y3 g) Z# \& A6 n) L Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; t# d2 `# A, C4 a" g
; F3 q$ r' a, R G4 L1 M* v Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
% k( a/ F) z# |: | & n0 h: g8 @0 o+ G* B2 T
Request timed out. 4 f) d* R2 a7 `. G2 K
' l- j# |% p8 p' x6 u: y+ q ………………
% E1 I7 t- U( l0 [. Q. z 2 q% X- K4 X5 s6 q8 I
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
; R/ D' X4 m$ u9 G9 ?
, a6 S; N$ Z' y8 W Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; K* ^; }$ t. u) s
/ I8 k( P" z; q2 c# @( Y/ D Ping statistics for 202.103.96.68: # z+ S5 ^! N# D9 C! h
: W" |: q7 `4 B; V2 ^. H5 {7 a
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds: 7 E( v& Y2 r$ g; k6 W
/ `! T% S+ z! n1 E y) W7 {) s
Minimum = 40ms, Maximum = 51ms, Average = 46ms
( B4 M) ~1 ?& N M1 l# k
/ t1 Z" R+ }5 B" B5 O8 e. P% ?2 { 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。 5 _9 Y' W& y! P$ s
! a) [) }- }! k N' z u5 x: s
-l size Send buffer size.
# l% H( e- d" H/ z2 _+ F3 L. w" t
0 C4 d; F1 N9 k8 s* T. o 定义echo数据包大小。 |
|