How to make a Ping indicating the time of sending/receiving a package?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
6 views
Need to get string like:
Exchange of packets at the 192.168.213.1 with 32 bytes of data:
[09:54:01] 192.168.213.1 Reply from: bytes=32 time<1ms TTL=64
[09:54:02] 192.168.213.1 Reply from: bytes=32 time<1ms TTL=64
...

plus, it is desirable to record it in the log. Decisions need 2, for Windows and Linux.

Below that does not offer this mockery:
time /t >> 1.txt & ping -n 1 xxx.yyy.zzz.www >> 1.txt\\

UPD: the solution for Windows and Linux.
by | 6 views

3 Answers

0 like 0 dislike
Version for Windows:
for /l %i in (0,0,1) do @cmd /c "echo.|set/p=%TIME:~0,8^%" & ping -n 1 google.com | find "Reply" & ping-n 2 localhost > nul 
by
0 like 0 dislike
#!/bin/bash while true do TIME=`date +%T` PING=`ping $1 -c 2 | grep icmp | grep seq=2` echo "[$TIME] $PING" >>/tmp/pingtime.log echo "[$TIME] $PING" sleep 5 done 

\r
\rimage
by
0 like 0 dislike
2bondbig so gives
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
2 answers
0 like 0 dislike
2 answers
asked Jun 13, 2019 by theMANTIS
0 like 0 dislike
6 answers
110,608 questions
257,186 answers
0 comments
25,729 users