How to get output of ping command without Ping statistics?

16.4k views Asked by At

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)?

2

There are 2 answers

1
iz25 On BEST ANSWER

Maybe using this command:

ping -n 1 ::1 | find "string to search"
0
Maybe On

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

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