2012-09-18

Bash Shell: Repeat a command every x seconds, e.g. to update list of files

When running a command that changes/creates files and takes a while, one might be interested in seeing how progress is going.
For this the "watch" command can be useful:


watch -n 2 ls *file

This will print the output of "ls *file" every 2 seconds.


watch -n 2 -d ls *file

Adding -d will highlight all the changes in comparison to the last time the command was performed

No comments:

Post a Comment