Linux Shell Tips - watch

If you want to monitor some command execution in time like "tail -f" for files, probably your linux box have nice solution for you:

watch -n 1 'ls -l'

Where:
'-n 1' - time (in seconds) to refresh command output
'ls -l' - command to execute in interval above

When we add '-d' option (help: highlight changes between updates), watch inform Us what was changed between command executions.

Example for 'ls' command below:


watch --color -n 10 -d 'ls -la'

Output:



After change in directory structure watch informs us about changes:

comments powered by Disqus