Monitor output periodically

tux11

Many times we need to monitor output of some command periodically to check what part or values changes. To do it either you need to run program manually and check for changed output. This way is not that efficient either when you are free or busy.

Today I will tell you about a program which runs another program periodically. That’s watch !

Watch executes given program periodically and lets you monitor output, errors, etc.

for e.g.

you have to monitor contents of file /proc/stat

$ watch cat /proc/stat

By default watch will execute program every two second which could be changed by -n option.

To highlight changes since last execute use -d

For more info see man page watch(1).

Enjoy!

 

 

 

Post a Comment

You must be logged in to post a comment.
%d bloggers like this: