Question: Hello how can I use grep on my ping command below to receive the ping result desired. I only want the pinging IP address and
Hello how can I use grep on my ping command below to receive the ping result desired. I only want the pinging IP address and IP ping results displayed.
ping 172.217.165.4 -c2
This is the result that I want to receive
Pinging 172.217.65.4:
64 bytes from 8.8.8.8: icmp_seq=1 ttl=120 time=1.69 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=120 time=0.747 ms
This is the result that I am getting
--- 172.217.165.4 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 1002ms rtt min/avg/max/mdev = 0.930/1.207/1.484/0.277 ms PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. 64 bytes from 8.8.8.8: icmp_seq=1 ttl=120 time=1.69 ms 64 bytes from 8.8.8.8: icmp_seq=2 ttl=120 time=0.747 ms
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
