ping
时间:2006-08-02 来源:anima
ping
ping [options] host
System administration command. Confirm that a remote host is online and responding. ping is intended for use in network testing, measurement, and management. Because of the load it can impose on the network, it is unwise to use ping during normal operations or from automated scripts.
Options
-aMake ping audible. Beep each time response is received.
-AAdapt to return interval of packets. Like -f ping, sends packets at approximately the rate at which they are received. This option may be used by an unprivileged user.
-bPing a broadcast address.
-BBind to original source address and do not change.
-c countStop after sending (and receiving) count ECHO_RESPONSE packets.
-fFlood ping-output packets as fast as they come back or 100 times per second, whichever is greater. This can be very hard on a network and should be used with caution. Only a privileged user may use this option.
-i waitWait wait seconds between sending each packet. Default is to wait one second between each packet. This option is incompatible with the -f option.
-I nameSet source address to interface name. name may also be specified as an IP address.
-l preloadSend preload number of packets as fast as possible before falling into normal mode of behavior.
-LIf destination is a multicast address, suppress loopback.
-M hintSpecify Path MTU Discovery strategy. Accepted values are do, want, or dont.
-nNumeric output only. No attempt will be made to look up symbolic names for host addresses.
-p digitsSpecify up to 16 pad bytes to fill out packet sent. This is useful for diagnosing data-dependent problems in a network. digits are in hex. For example, -p ff will cause the sent packet to be filled with all 1s.
-qQuiet output—nothing is displayed except the summary lines at startup time and when finished.
-Q tosSet Quality of Service on ICMP datagrams.
-rBypass the normal routing tables and send directly to a host on an attached network.
-RSet the IP record route option, which will store the route of the packet inside the IP header. The contents of the record route will be printed if the -v option is given, and will be set on return packets if the target host preserves the record route option across echoes or if the -l option is given.
-s packetsizeSpecify number of data bytes to be sent. Default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data.
-S sizeSet send buffer (SNDBUF) size. The default is the size of one packet.
-t nSet the IP Time to Live to n seconds.
-T optionSet IP timestamp options. Accepted option values are:
tsonlyTimestamps only.
tsandaddrTimestamps and addresses.
tsprespec hostsTimestamps with prespecified hops of one or more hosts.
-UUse older ping behavior and print full user-to-user latency instead of network round-trip time.
-vVerbose; list ICMP packets received other than ECHO_RESPONSE.
-VPrint version, then exit.
-w nExit ping after n seconds.
-W nWhen waiting for a response, time out after n seconds.