Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference Between Ping on Windows and Ubuntu

I was messing around with the ping command on the terminal in Ubuntu, and I found something that confused me:

The Terminal makes an insane amount of send/receives, yet the Windows command prompt only sends a few packets and then exits. The only way I have been able to get a result is to use Ctl+C to stop the output on the Ubuntu Terminal.

What is going on here? I know that there is a large difference between the Windows command prompt and the terminal on Ubuntu, but I cannot figure out what that difference is. Is it possible that I am not using the correct syntax? (ping example.com)

Any ideas/help is appreciated.

like image 574
nmagerko Avatar asked Dec 12 '22 05:12

nmagerko


2 Answers

Since Windows normally sends out 4 packets by default you can do:

ping -c 4 example.com

to achieve the same behavior as Windows on Ubuntu. If you want it the other way around you could do

ping -t example.com
like image 165
Karlson Avatar answered Dec 14 '22 19:12

Karlson


They are two different programs, that have different default behavior. You can actually make one behave like another

On windows run:

 ping -t example.com

On linux

 ping -c 10  example.com

Look here for details

  • Linux
  • Windows
like image 21
Vlad Avatar answered Dec 14 '22 18:12

Vlad