duminică, 2 septembrie 2012

Tips and tricks: watch and cat

Sometimes it is necessary to find solutions.

Today's example involves two linux commands:

watch and cat

Here is a simple method by creating a script that returns an output:

while [ 1 ]; do cat /proc/meminfo; date; echo; sleep 1; done

Make this script executable and name it: meminfo

Output is then processed by the command:

$ watch -d ./meminfo 

This simple method can be applied to other files ...