![]() Redirect the ping command output to a file ![]() In the following example, ping command will send only 2 packets and you don’t need to press CTRL-C to terminate the output.Ħ4 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.024 msĢ packets transmitted, 2 received, 0% packet loss, time 999ms Ping Command – Non Interactive Mode (Specify number of packets to be sent) In the following example, you have to press CTRL-C to terminate the ping command output.Ħ4 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.023 msĦ4 bytes from 127.0.0.1: icmp_seq=2 ttl=64 time=0.006 msĦ4 bytes from 127.0.0.1: icmp_seq=3 ttl=64 time=0.004 msĦ4 bytes from 127.0.0.1: icmp_seq=4 ttl=64 time=0.005 msĥ packets transmitted, 5 received, 0% packet loss, time 3999ms After sending N number of packets, ping command will terminate automatically as explained below. How can I execute ping command only for N number of packets and terminate the output automatically?Īnswer: Use ping option -c to specify the number of packets. ![]() Question: When I execute ping command from the command line, it keeps sending the packets until I hit CTRL-C to terminate the ping command output.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |