Stop watching the output of a particular program after using watch command?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have come to know that we can use watch command to monitor the output of other command and it prints the output every 2 seconds by default, which is really useful.



I start to use it to monitor the output of nvidia-smi, for example. But now I do not know how to quit the program (stop monitoring the output of nvidia-smi). I tried to press q and there is no response.



Searching the internet with similar title gives me no clue. There are only some tutorials on how to use watch and its options and I can not find a way to stop the command. I am stuck here.







share|improve this question


























    up vote
    0
    down vote

    favorite












    I have come to know that we can use watch command to monitor the output of other command and it prints the output every 2 seconds by default, which is really useful.



    I start to use it to monitor the output of nvidia-smi, for example. But now I do not know how to quit the program (stop monitoring the output of nvidia-smi). I tried to press q and there is no response.



    Searching the internet with similar title gives me no clue. There are only some tutorials on how to use watch and its options and I can not find a way to stop the command. I am stuck here.







    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have come to know that we can use watch command to monitor the output of other command and it prints the output every 2 seconds by default, which is really useful.



      I start to use it to monitor the output of nvidia-smi, for example. But now I do not know how to quit the program (stop monitoring the output of nvidia-smi). I tried to press q and there is no response.



      Searching the internet with similar title gives me no clue. There are only some tutorials on how to use watch and its options and I can not find a way to stop the command. I am stuck here.







      share|improve this question














      I have come to know that we can use watch command to monitor the output of other command and it prints the output every 2 seconds by default, which is really useful.



      I start to use it to monitor the output of nvidia-smi, for example. But now I do not know how to quit the program (stop monitoring the output of nvidia-smi). I tried to press q and there is no response.



      Searching the internet with similar title gives me no clue. There are only some tutorials on how to use watch and its options and I can not find a way to stop the command. I am stuck here.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 6 '17 at 9:11

























      asked Dec 6 '17 at 8:48









      jdhao

      1468




      1468




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          From man watch:




          By default, watch will run until interrupted.




          The key words are "until interrupted", which basically can be interpreted as until (but not limited to) the following happening:



          • The user (you) pressed CTRL+C in the terminal.

          • The system restarted.

          • The process was issued a kill request.





          share|improve this answer




















          • I am curious to know why there is no shortcut to use q to stop watching, just like when we are using less or man command. A lot of command support the use of q to quit.
            – jdhao
            Dec 6 '17 at 9:15










          • I am not one of the programmers and I can not answer for them. As far as I understand, the source code for watch is available and you should be able to either fork it and create your own version that includes the option to press Q to quit or extend it like others have by submitting a patch or getting directly involved in the program development.
            – Tigger
            Dec 6 '17 at 10:02











          • @Hao, note that reacting to a signal (generated by Ctrl+C) and reading tokens from stdin are very different code paths. less and man accept a variety of keystroke commands; q is just another among several. watch accepts no keystroke commands, so it would be functionality added only for quit.
            – user4556274
            Dec 6 '17 at 13:15

















          up vote
          1
          down vote













          Press CRTL+C to stop the command






          share|improve this answer




















            Your Answer







            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "106"
            ;
            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',
            convertImagesToLinks: false,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409132%2fstop-watching-the-output-of-a-particular-program-after-using-watch-command%23new-answer', 'question_page');

            );

            Post as a guest






























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            4
            down vote



            accepted










            From man watch:




            By default, watch will run until interrupted.




            The key words are "until interrupted", which basically can be interpreted as until (but not limited to) the following happening:



            • The user (you) pressed CTRL+C in the terminal.

            • The system restarted.

            • The process was issued a kill request.





            share|improve this answer




















            • I am curious to know why there is no shortcut to use q to stop watching, just like when we are using less or man command. A lot of command support the use of q to quit.
              – jdhao
              Dec 6 '17 at 9:15










            • I am not one of the programmers and I can not answer for them. As far as I understand, the source code for watch is available and you should be able to either fork it and create your own version that includes the option to press Q to quit or extend it like others have by submitting a patch or getting directly involved in the program development.
              – Tigger
              Dec 6 '17 at 10:02











            • @Hao, note that reacting to a signal (generated by Ctrl+C) and reading tokens from stdin are very different code paths. less and man accept a variety of keystroke commands; q is just another among several. watch accepts no keystroke commands, so it would be functionality added only for quit.
              – user4556274
              Dec 6 '17 at 13:15














            up vote
            4
            down vote



            accepted










            From man watch:




            By default, watch will run until interrupted.




            The key words are "until interrupted", which basically can be interpreted as until (but not limited to) the following happening:



            • The user (you) pressed CTRL+C in the terminal.

            • The system restarted.

            • The process was issued a kill request.





            share|improve this answer




















            • I am curious to know why there is no shortcut to use q to stop watching, just like when we are using less or man command. A lot of command support the use of q to quit.
              – jdhao
              Dec 6 '17 at 9:15










            • I am not one of the programmers and I can not answer for them. As far as I understand, the source code for watch is available and you should be able to either fork it and create your own version that includes the option to press Q to quit or extend it like others have by submitting a patch or getting directly involved in the program development.
              – Tigger
              Dec 6 '17 at 10:02











            • @Hao, note that reacting to a signal (generated by Ctrl+C) and reading tokens from stdin are very different code paths. less and man accept a variety of keystroke commands; q is just another among several. watch accepts no keystroke commands, so it would be functionality added only for quit.
              – user4556274
              Dec 6 '17 at 13:15












            up vote
            4
            down vote



            accepted







            up vote
            4
            down vote



            accepted






            From man watch:




            By default, watch will run until interrupted.




            The key words are "until interrupted", which basically can be interpreted as until (but not limited to) the following happening:



            • The user (you) pressed CTRL+C in the terminal.

            • The system restarted.

            • The process was issued a kill request.





            share|improve this answer












            From man watch:




            By default, watch will run until interrupted.




            The key words are "until interrupted", which basically can be interpreted as until (but not limited to) the following happening:



            • The user (you) pressed CTRL+C in the terminal.

            • The system restarted.

            • The process was issued a kill request.






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Dec 6 '17 at 8:57









            Tigger

            1,916812




            1,916812











            • I am curious to know why there is no shortcut to use q to stop watching, just like when we are using less or man command. A lot of command support the use of q to quit.
              – jdhao
              Dec 6 '17 at 9:15










            • I am not one of the programmers and I can not answer for them. As far as I understand, the source code for watch is available and you should be able to either fork it and create your own version that includes the option to press Q to quit or extend it like others have by submitting a patch or getting directly involved in the program development.
              – Tigger
              Dec 6 '17 at 10:02











            • @Hao, note that reacting to a signal (generated by Ctrl+C) and reading tokens from stdin are very different code paths. less and man accept a variety of keystroke commands; q is just another among several. watch accepts no keystroke commands, so it would be functionality added only for quit.
              – user4556274
              Dec 6 '17 at 13:15
















            • I am curious to know why there is no shortcut to use q to stop watching, just like when we are using less or man command. A lot of command support the use of q to quit.
              – jdhao
              Dec 6 '17 at 9:15










            • I am not one of the programmers and I can not answer for them. As far as I understand, the source code for watch is available and you should be able to either fork it and create your own version that includes the option to press Q to quit or extend it like others have by submitting a patch or getting directly involved in the program development.
              – Tigger
              Dec 6 '17 at 10:02











            • @Hao, note that reacting to a signal (generated by Ctrl+C) and reading tokens from stdin are very different code paths. less and man accept a variety of keystroke commands; q is just another among several. watch accepts no keystroke commands, so it would be functionality added only for quit.
              – user4556274
              Dec 6 '17 at 13:15















            I am curious to know why there is no shortcut to use q to stop watching, just like when we are using less or man command. A lot of command support the use of q to quit.
            – jdhao
            Dec 6 '17 at 9:15




            I am curious to know why there is no shortcut to use q to stop watching, just like when we are using less or man command. A lot of command support the use of q to quit.
            – jdhao
            Dec 6 '17 at 9:15












            I am not one of the programmers and I can not answer for them. As far as I understand, the source code for watch is available and you should be able to either fork it and create your own version that includes the option to press Q to quit or extend it like others have by submitting a patch or getting directly involved in the program development.
            – Tigger
            Dec 6 '17 at 10:02





            I am not one of the programmers and I can not answer for them. As far as I understand, the source code for watch is available and you should be able to either fork it and create your own version that includes the option to press Q to quit or extend it like others have by submitting a patch or getting directly involved in the program development.
            – Tigger
            Dec 6 '17 at 10:02













            @Hao, note that reacting to a signal (generated by Ctrl+C) and reading tokens from stdin are very different code paths. less and man accept a variety of keystroke commands; q is just another among several. watch accepts no keystroke commands, so it would be functionality added only for quit.
            – user4556274
            Dec 6 '17 at 13:15




            @Hao, note that reacting to a signal (generated by Ctrl+C) and reading tokens from stdin are very different code paths. less and man accept a variety of keystroke commands; q is just another among several. watch accepts no keystroke commands, so it would be functionality added only for quit.
            – user4556274
            Dec 6 '17 at 13:15












            up vote
            1
            down vote













            Press CRTL+C to stop the command






            share|improve this answer
























              up vote
              1
              down vote













              Press CRTL+C to stop the command






              share|improve this answer






















                up vote
                1
                down vote










                up vote
                1
                down vote









                Press CRTL+C to stop the command






                share|improve this answer












                Press CRTL+C to stop the command







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Dec 6 '17 at 8:56









                BANJOSA

                1485




                1485



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f409132%2fstop-watching-the-output-of-a-particular-program-after-using-watch-command%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Popular posts from this blog

                    How to check contact read email or not when send email to Individual?

                    Bahrain

                    Postfix configuration issue with fips on centos 7; mailgun relay