|
  
- UID
- 3
- 帖子
- 66
- 精华
- 1
- 积分
- 2387
- 金币
- 1067
- 威望
- 1015
- 贡献
- 1000
|
教你正确使用Windows的Ping命令
对于Windows下ping命令相信大家已经再熟悉不过了,但是能把ping的功能发挥到最大的人却并不是很多,当然我也并不是说我可以让ping发挥最大的功能,我也只不过经常用ping这个工具,也总结了一些小经验,现在和大家分享一下。
/ X( a5 m7 q) a% o& H2 F
7 o8 ?( A. r0 M' B+ | 现在我就参照ping命令的帮助说明来给大家说说我使用ping时会用到的技巧,ping只有在安装了TCP/IP协议以后才可以使用: 6 h J: Q+ ~: J
. i6 p- a6 Z" C+ ]4 }/ N, M, d
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 ! W, N8 \, X7 C6 S; _# A' r' c7 ~3 i
7 k3 O+ e |+ G# a! u Options:
# `# z- z8 T; R: r4 Z ) j# M, O& S8 U8 p
-t Ping the specified host until stopped.To see statistics and continue - type Control-Break;To stop - type Control-C. * {. b# P5 W0 G
, u$ n* T5 Y' u4 J; _! L. v 不停的ping地方主机,直到你按下Control-C。
. d" {+ ?+ z/ F' s% l& I3 W, h & J( E$ i2 C/ x8 P4 y
此功能没有什么特别的技巧,不过可以配合其他参数使用,将在下面提到。
, T1 [. J2 }2 U5 _. O9 B/ s0 f b& j
: w: h3 i5 P# a/ l9 Y; Q1 b3 y -a Resolve addresses to hostnames. " t! N0 n) b/ F7 W! A% D3 g* Q
6 v1 p& N- o, U9 J- q8 Y 解析计算机NetBios名。 8 [- D0 ]$ o6 W3 i
, g: f( q" U& V2 O( i$ |% R
示例:C:\>ping -a 192.168.1.21
- K+ N! [5 I9 v9 R
. ^$ I* Y& C# k7 e" a1 z9 \ Pinging iceblood.yofor.com [192.168.1.21] with 32 bytes of data:
- X" s; K6 r- o- y& e
6 u9 H" L8 @+ Q! C. U1 h- U Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 % P& M* A/ m: t! a
4 L$ G/ i" U0 U# S/ @5 U# c Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 + w8 J3 u1 q% u& ^# Q2 `
0 K. C; t$ m- K: q u7 P. x: l
Reply from 192.168.1.21: bytes=32 time<10ms TTL=254
2 D3 w( N) h( z0 W8 w Y9 V* O% V1 q' r% t
. n5 W9 f/ T7 h& d* n* J Reply from 192.168.1.21: bytes=32 time<10ms TTL=254 ( o$ d1 B# B" ]* v' d
% e. S. e5 M( X; B9 V3 e
Ping statistics for 192.168.1.21: & b( ?: l# k1 I& I6 I) A/ I
+ P, P' f# X; q Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),Approximate round trip times in milli-seconds:
3 `: M+ M s5 x8 L% X7 @; h0 X - n' y, y; ~% M: A: S% v
Minimum = 0ms, Maximum = 0ms, Average = 0ms
D8 b! B" X. ~# k) W: \1 \
6 Y2 c2 S \$ `2 i1 W3 B( a. C8 g" v 从上面就可以知道IP为192.168.1.21的计算机NetBios名为iceblood.yofor.com。
1 Y( _% a: r$ ^0 [ & e$ H9 Y6 g" U2 j* H
-n count Number of echo requests to send. 4 v; C5 `, B/ Z. _. L# m g: @7 s
2 I8 {) D6 ~1 d0 E+ [, Z
发送count指定的Echo数据包数。 , M7 g1 ]8 D4 O7 P# a- X
# Z- E, ^ k$ m J' `
在默认情况下,一般都只发送四个数据包,通过这个命令可以自己定义发送的个数,对衡量网络速度很有帮助,比如我想测试发送50个数据包的返回的平均时间为多少,最快时间为多少,最慢时间为多少就可以通过以下获知: ! U: v' `( g. F% u/ ]
' G1 {7 c) p( ]; a' A4 i* H( A
C:\>ping -n 50 202.103.96.68 $ h- x; S0 d& J5 |
, n8 v1 {- ?: ~/ R
Pinging 202.103.96.68 with 32 bytes of data:
+ C' x0 l; ~1 D% L N
7 n3 Q! X3 N, s( {$ A# Y Reply from 202.103.96.68: bytes=32 time=50ms TTL=241
( U0 \2 E8 |6 |0 ] : Y& {5 j8 C2 v R
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 4 @1 t! _) Z1 _# D" `- i m
N, L) z g6 {; K Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ) J' r0 i. y9 L3 o& D& m
4 p' K5 m* t% t# M$ K
Request timed out.
8 }( {, J0 z! s! x- S! i 6 T- r6 o. Q% ]( W2 C% B9 q3 C
………………
! z, g4 {. w* X; q9 J& v $ }% T7 X1 f+ q/ K
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 ; J' w1 }2 m; T. \* O
S; W' k" o$ L* X5 c
Reply from 202.103.96.68: bytes=32 time=50ms TTL=241 * u& a/ x; M; z9 c3 G9 U- y
" V6 s* J( t7 e$ }2 u' M1 P4 x7 r Ping statistics for 202.103.96.68: $ ]. m, T4 H$ X$ e4 q
7 q3 e) V! g2 s5 S0 R1 W$ A' d
Packets: Sent = 50, Received = 48, Lost = 2 (4% loss),Approximate round trip times in milli-seconds:
+ D) a `# F3 t+ _+ A & Y) \# U7 Z; T7 T4 B# I
Minimum = 40ms, Maximum = 51ms, Average = 46ms ; H; c' b* ]7 L/ G* \; d
# k7 T6 N- A: L" N! i 从以上我就可以知道在给202.103.96.68发送50个数据包的过程当中,返回了48个,其中有两个由于未知原因丢失,这48个数据包当中返回速度最快为40ms,最慢为51ms,平均速度为46ms。
! x* H: X' } O" k y. g D0 K8 {% }) |! Y3 C% h
-l size Send buffer size.
$ w; U2 X& K2 U G6 s& ?$ S9 |
5 F9 y* C! e7 y& d5 B4 ` 定义echo数据包大小。 |
|