6

I have executed

>> watch tree ./

Now my problem is I'm unable to exit from watch - without closing the terminal.

I read man page of watch but they have not mentioned how to exit from watch screen.

Is there is magic key combo that you need to use to exit from watch ?

It's like one those problems you face when you for the first time open vim and don't know how to close it.

jaggi
  • 166

1 Answers1

7

Press Ctrl-C to interrupt watch. Ctrl-C is the general key combination to kill the foreground process in the shell. If that fails (it sometimes does for hung processes), pressing Ctrl-Z and issuing kill -9 %1to kill process number one works.

If you press Ctrl-Z you can do more things:

  • Resume the job to foreground by running fg
  • Resume the job in the background running bg
  • List running jobs using jobs
  • Manipulate the job, as mentioned, using kill
  • Change priority of job using renice
  • Start new jobs, leaving the old running in the background
vidarlo
  • 23,497