- 1 year ago
One-line ping answer with time and RTD on Windows
Comment
1 / 1
To get a one-line output of the ping command with the time and Round Trip Time (RTT) on Windows, you can use the following command in Command Prompt:
cmdping -n 1 www.example.com | findstr /R /C:"^Reply from" /C:"time="
Replace www.example.com
with the website or IP address you want to ping.
This command sends a single ping packet to the specified host (-n 1
), and then filters the output using findstr
to only display lines starting with "Reply from" (indicating a successful ping response) and containing "time=" (which shows the time and RTT).
The output will be something like this:
pythonReply from 192.168.0.1: bytes=32 time=10ms TTL=128
This shows the IP address, bytes of data sent, time, and TTL (Time to Live) for the successful ping response.