I am curious if there's a tool or an easy way to continually execute a certain command in given intervals, and reprint its output into same place on the screen.
The example that prompted me to think about it is 'dropbox-cli status'. Manually executed:
$> dropbox-cli status
Syncing (6,762 files remaining)
Indexing 3,481 files...
$> dropbox-cli status
Syncing (5,162 files remaining)
Indexing 2,681 files...
I am looking for:
$> tracker --interval=1s "dropbox-cli status"
Syncing (6,743 files remaining)
Indexing 3,483 files
The imaginary command 'tracker' would block and the two output lines would be continually reprinted over every second, rather than creating an appending log output.
You can use watch
watch -n1 dropbox-cli status
Specify the time in seconds with param -n
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With