Other Services :-

Linux watch command

Watch command is one of the most useful commands which mainly helps to keep an update on various system administrative processes. Today’s Internet facility provides for the hackers to intrude into any system which is not well secured and regularly monitored for such attacks. These all can be monitored through the log files which are updated regularly. These regularly updated logs can be checked by executing the commands frequently. Since it is a tedious task to execute the commands repeatedly to view the logs. Commands such as head, tail, cat etc. which are used to read the files are usually used to check the logs. This is where the importance of watch commands comes into the picture. The watch command allows you to regularly repeat a command and produce the output. The burden of frequently executing the commands is avoided for the system administrators.

Watch Command

The syntax of watch command is:

watch [options] command

The running period of watch command is by default 2 seconds. The running time cycle is counted between the full execution of the command and start of next execution.

Examples:

1) The given example provides updated error/notices/warning every 2 seconds.