I was searching for a way to make some kind of a live memory usage monitoring in Linux when I found watch. I wonder why didn’t I ever knew about it! It’s damn useful! You can monitor literally everything with watch.

Here are some scenarios you may use if for:

Watch for changes in a directory:

watch ls -la

Watch for any Java program being started/stopped:

watch -n 1 "ps ax | grep java"

I used watch for memory usage monitoring:

$~ watch -n 1 free -m
$~ watch -n 1 cat /proc/meminfo

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">