100 Useful Command-Line Utilities

by Oliver; 2014

90. watch

If you prefix a command with watch, it will repeat every 2.0 seconds and you can monitor it. For instance, if a file in /some/directory is growing, and you want to monitor the directory's size:
$ watch ls -hl /some/directory
Sometimes you want to monitor how much space you have left on your computer:
$ watch df -h .
If a program is churning away and slowly writing to a log file, you can watch the tail:
$ watch tail log.txt
Another example is using watch in combination with the Oracle Grid Engine's qstat to monitor your job status:
$ watch qstat

<PREV   NEXT>