This command executes a command in a loop with the specified delay. Useful for instance if you want to monitor the status of your machine (disk space, network status…)
$ watch -n 4 du -ch .
The command above, executes “du -ch .” every four seconds.
Note: That’s a GNU command. Under FreeBSD watch is a completely different program. In order to use the GNU watch command, you have to install the gnu-watch package.
Note 2: If you don’t like watch you can always do something like this:
$ while true; do command; sleep delay; done
but watch is shorter XD
Well, I’d rather use
# watch -n 4 du -cs .
which just outputs the grand total (enough to know whether something has changed or not).
[...] how many times you wan to update the information you want displayed. I find iostat more useful with gnu-watch Enjoy! Tagged: bsd, iostat, [...]