1

In windows 8 I used to do in run:

ping 166.18.0.1 -t

where 166.18.0.1 is my DNS IP(suppose).

How to do this same thing in ubuntu? I have already tried this in the terminal window but it shows an error:

option requires an argument t

So how to do this?

5
  • 1
    And what does -t do on windows?
    – muru
    Jun 24, 2015 at 18:19
  • Isn't -t to run the ping indefinitely in windows?
    – heemayl
    Jun 24, 2015 at 18:21
  • And the default ping output shows the TTL. So why do you need an option?
    – muru
    Jun 24, 2015 at 18:21
  • I believe that in Windows, it's used to keep the ping going until you break, allowing the command prompt ping to act like ping naturally does in Ubuntu, and Linux in general. Jun 24, 2015 at 18:22
  • Actually in windows it was pinging with 32 bytes of data but here it is doing using 64 bytes,how to change that
    – Sourajit
    Jun 24, 2015 at 18:24

3 Answers 3

6

Only ping 166.18.0.1 would do.

In Ubuntu by default ping continues to run indefinitely unless you mention a limit (by the -c option), so ping 166.18.0.1 is the same as windows ping 166.18.0.1 -t.

In Ubuntu the -t option of ping is to set a TTL value, as you have inserted the -t option without giving a TTL value you are getting the error saying you need to give a value to -t.

If you need to change the ICMP packet size from 64 bytes to 32 bytes:

ping -s 24 166.18.0.1

As 8 byte ICMP header is added so the total packet size would be 24+8=32 bytes.

Check man ping to get more idea.

2
  • ok its working with 32 bytes but it is not showing any request time outs[it used to show when I used window] is that thing normal or is there some other command to view it in that manner
    – Sourajit
    Jun 24, 2015 at 18:35
  • @Sourajit It shows the RTT....check the rightmost values of each response..for example time=339 ms..
    – heemayl
    Jun 24, 2015 at 18:38
2

ping -t <IP_ADDRESS> in Windows is equivalent to ping <IP_ADDRESS> in Linux.

You should always begin by reading the man page of a program before using it:

man ping
1

When it comes to Ubuntu, using the -t will require an argument to set time to live for IP Packets. If you want it to ping more than 4 times (a command prompt default with Windows), just run ping xxx.xxx.xxx.xxx in Ubuntu. It will keep pinging until you tell it to stop with a ctrl-c.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .