Ping for 60 seconds Announcing the arrival of Valued Associate #679: Cesar Manara ...

What does 丫 mean? 丫是什么意思?

How can I prevent/balance waiting and turtling as a response to cooldown mechanics

AppleTVs create a chatty alternate WiFi network

Deconstruction is ambiguous

How to report t statistic from R

Random body shuffle every night—can we still function?

Draw 4 of the same figure in the same tikzpicture

If Windows 7 doesn't support WSL, then what is "Subsystem for UNIX-based Applications"?

Should a wizard buy fine inks every time he want to copy spells into his spellbook?

The test team as an enemy of development? And how can this be avoided?

What does this say in Elvish?

Most bit efficient text communication method?

Electrolysis of water: Which equations to use? (IB Chem)

Why does 14 CFR have skipped subparts in my ASA 2019 FAR/AIM book?

What order were files/directories output in dir?

Is there public access to the Meteor Crater in Arizona?

What does it mean that physics no longer uses mechanical models to describe phenomena?

Is multiple magic items in one inherently imbalanced?

What is the difference between a "ranged attack" and a "ranged weapon attack"?

Converted a Scalar function to a TVF function for parallel execution-Still running in Serial mode

Why weren't discrete x86 CPUs ever used in game hardware?

How does light 'choose' between wave and particle behaviour?

How would a mousetrap for use in space work?

Flash light on something



Ping for 60 seconds



Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)How to command “Ping” display time and date of pingPing for 4 timesHow to show failed ping?Unable to ping Ubuntu from WindowsUbuntu can not ping Host Name but can ping IP?Advanced Ping ScriptPing monitoring programCan't ping wordpress.orgSimple Ping Tool FailingUbuntu 18.04 server unable to ping websites but can ping IP addresses





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







5















I want to ping an IP Address for 60 seconds. Like in Windows, you specify the time with '-t' flag.



ping 192.168.1.1 -t60


Is it possible in Linux?










share|improve this question




















  • 1





    Thanks for the prompt reply. I am sending 1000 packets/seconds '-i 0.001'. So -c doesn't work for me.

    – mgmihir
    Nov 20 '17 at 14:52








  • 1





    How about ping -w timeout?

    – John Anderson
    Nov 20 '17 at 14:54











  • You can ping faster than 0.200 if you are superuser

    – mgmihir
    Nov 20 '17 at 15:14


















5















I want to ping an IP Address for 60 seconds. Like in Windows, you specify the time with '-t' flag.



ping 192.168.1.1 -t60


Is it possible in Linux?










share|improve this question




















  • 1





    Thanks for the prompt reply. I am sending 1000 packets/seconds '-i 0.001'. So -c doesn't work for me.

    – mgmihir
    Nov 20 '17 at 14:52








  • 1





    How about ping -w timeout?

    – John Anderson
    Nov 20 '17 at 14:54











  • You can ping faster than 0.200 if you are superuser

    – mgmihir
    Nov 20 '17 at 15:14














5












5








5








I want to ping an IP Address for 60 seconds. Like in Windows, you specify the time with '-t' flag.



ping 192.168.1.1 -t60


Is it possible in Linux?










share|improve this question
















I want to ping an IP Address for 60 seconds. Like in Windows, you specify the time with '-t' flag.



ping 192.168.1.1 -t60


Is it possible in Linux?







command-line networking ping






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '17 at 16:04









muru

1




1










asked Nov 20 '17 at 14:49









mgmihirmgmihir

3114




3114








  • 1





    Thanks for the prompt reply. I am sending 1000 packets/seconds '-i 0.001'. So -c doesn't work for me.

    – mgmihir
    Nov 20 '17 at 14:52








  • 1





    How about ping -w timeout?

    – John Anderson
    Nov 20 '17 at 14:54











  • You can ping faster than 0.200 if you are superuser

    – mgmihir
    Nov 20 '17 at 15:14














  • 1





    Thanks for the prompt reply. I am sending 1000 packets/seconds '-i 0.001'. So -c doesn't work for me.

    – mgmihir
    Nov 20 '17 at 14:52








  • 1





    How about ping -w timeout?

    – John Anderson
    Nov 20 '17 at 14:54











  • You can ping faster than 0.200 if you are superuser

    – mgmihir
    Nov 20 '17 at 15:14








1




1





Thanks for the prompt reply. I am sending 1000 packets/seconds '-i 0.001'. So -c doesn't work for me.

– mgmihir
Nov 20 '17 at 14:52







Thanks for the prompt reply. I am sending 1000 packets/seconds '-i 0.001'. So -c doesn't work for me.

– mgmihir
Nov 20 '17 at 14:52






1




1





How about ping -w timeout?

– John Anderson
Nov 20 '17 at 14:54





How about ping -w timeout?

– John Anderson
Nov 20 '17 at 14:54













You can ping faster than 0.200 if you are superuser

– mgmihir
Nov 20 '17 at 15:14





You can ping faster than 0.200 if you are superuser

– mgmihir
Nov 20 '17 at 15:14










2 Answers
2






active

oldest

votes


















20














From man ping



   -w deadline
Specify a timeout, in seconds, before ping exits regardless of
how many packets have been sent or received. In this case ping
does not stop after count packet are sent, it waits either for
deadline expire or until count probes are answered or for some
error notification from network.


ex.



$ time ping -w60 192.168.1.65 &>/dev/null

real 1m0.001s
user 0m0.008s
sys 0m0.000s





share|improve this answer































    2














    The timeout command can be used also here. which is from Coreutils package in Linux.
    The command would be:



    timeout 60 ping google.com


    that's it.



    Note: here you can run any command with a time limit for execution.






    share|improve this answer


























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "89"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f978437%2fping-for-60-seconds%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      20














      From man ping



         -w deadline
      Specify a timeout, in seconds, before ping exits regardless of
      how many packets have been sent or received. In this case ping
      does not stop after count packet are sent, it waits either for
      deadline expire or until count probes are answered or for some
      error notification from network.


      ex.



      $ time ping -w60 192.168.1.65 &>/dev/null

      real 1m0.001s
      user 0m0.008s
      sys 0m0.000s





      share|improve this answer




























        20














        From man ping



           -w deadline
        Specify a timeout, in seconds, before ping exits regardless of
        how many packets have been sent or received. In this case ping
        does not stop after count packet are sent, it waits either for
        deadline expire or until count probes are answered or for some
        error notification from network.


        ex.



        $ time ping -w60 192.168.1.65 &>/dev/null

        real 1m0.001s
        user 0m0.008s
        sys 0m0.000s





        share|improve this answer


























          20












          20








          20







          From man ping



             -w deadline
          Specify a timeout, in seconds, before ping exits regardless of
          how many packets have been sent or received. In this case ping
          does not stop after count packet are sent, it waits either for
          deadline expire or until count probes are answered or for some
          error notification from network.


          ex.



          $ time ping -w60 192.168.1.65 &>/dev/null

          real 1m0.001s
          user 0m0.008s
          sys 0m0.000s





          share|improve this answer













          From man ping



             -w deadline
          Specify a timeout, in seconds, before ping exits regardless of
          how many packets have been sent or received. In this case ping
          does not stop after count packet are sent, it waits either for
          deadline expire or until count probes are answered or for some
          error notification from network.


          ex.



          $ time ping -w60 192.168.1.65 &>/dev/null

          real 1m0.001s
          user 0m0.008s
          sys 0m0.000s






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 20 '17 at 14:55









          steeldriversteeldriver

          71k11115187




          71k11115187

























              2














              The timeout command can be used also here. which is from Coreutils package in Linux.
              The command would be:



              timeout 60 ping google.com


              that's it.



              Note: here you can run any command with a time limit for execution.






              share|improve this answer






























                2














                The timeout command can be used also here. which is from Coreutils package in Linux.
                The command would be:



                timeout 60 ping google.com


                that's it.



                Note: here you can run any command with a time limit for execution.






                share|improve this answer




























                  2












                  2








                  2







                  The timeout command can be used also here. which is from Coreutils package in Linux.
                  The command would be:



                  timeout 60 ping google.com


                  that's it.



                  Note: here you can run any command with a time limit for execution.






                  share|improve this answer















                  The timeout command can be used also here. which is from Coreutils package in Linux.
                  The command would be:



                  timeout 60 ping google.com


                  that's it.



                  Note: here you can run any command with a time limit for execution.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited 2 hours ago









                  Sergiy Kolodyazhnyy

                  75.7k9156331




                  75.7k9156331










                  answered 2 hours ago









                  linux.cnflinux.cnf

                  214




                  214






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Ask Ubuntu!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f978437%2fping-for-60-seconds%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Why do type traits not work with types in namespace scope?What are POD types in C++?Why can templates only be...

                      Will tsunami waves travel forever if there was no land?Why do tsunami waves begin with the water flowing away...

                      Should I use Docker or LXD?How to cache (more) data on SSD/RAM to avoid spin up?Unable to get Windows File...