简体   繁体   中英

How to get output of ping command without Ping statistics?

For example, in Windows 7 output of command

ping -n 1 ::1

is following:

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms

Is it possible to get output without Ping statistics (without the last four lines in this case or without two lines in case if destination host is unreachable)?

也许使用这个命令:

ping -n 1 ::1 | find "string to search"

The currently accepted answer would filter out 'Request timed out' errors. Instead, use findstr /BR, which only outputs lines that start with R:

ping -n 1 ::1 | findstr /B R

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM