Bash simple monitor one-liner

Did you ever need to monitor live your free memory, or if some files are getting written during the execution of an automated process, or anything else?

I've been in this situation many times, and often I simply repeated the same command over and over ( you know, command-up arrow-enter-up arrow-enter-up arrow-enter etc.) .

Finally I reasoned about that and I found a simple bash one-liner to repeat the same command over and over:

while true; do <command>; sleep 2; clear; done

It is in fact a simple bash while loop. Here is the explanation:

Surely it's not a great innovation, but feel free to use it as you like, if you find it useful!

RELATED POSTS

Labels: