The Archives

  • 19.May.08
    Executing a command in a loop with a delay cmd | fernape | (2)
    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