Watch Linux Command Output

Ever wanted to watch the output of a Linux command the same way you would want to watch lines being added to a file?

Watch is a very simple Linux utility that allows you to effectively run the same command over and over in full screen, effectively giving you a live view of what you are looking at.

Perhaps you are doing a large backup and want to watch your hard drive volumes as they slowly tick their way towards 0 bytes free. You use the df -h command but are irritated that you have to keep pressing keys to get an update. If only there were a better way...

Fortunately, there is:

watch -n 10 df -h

This will output the results of the df -h command every 10 seconds thus providing a live view of your volumes capacity.

Tags