View program output with watch


Watch runs a program at regular interval and continuously displays the output. This allows you keep track of the changes that are occurring in the program over time.

Run watch in the following way.

By default watch updates the command output every 2 seconds. To change this interval us the ‘-n seconds‘ option.

This will keep an eye on the changes occurring in your home directory. This will update the command output every second.

If you use the ‘-d‘ option, watch will highlight the differences between the current and previous update. Adding ‘-d=cumulative‘ will make the highlights permanent, allowing you to see what has changed throughout the entire run.

String longer commands together by enclosing them in single quotes.

Watch will continue to run until you exit the program by pressing Ctrl-C.