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

linuxwatch

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.

Best 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.
Related Question