summaryrefslogblamecommitdiffstats
path: root/bin/mem.sh
blob: decc2fd28fccd37da6e4928300343954734e52c3 (plain) (tree)




















                                                                                                            
#!/bin/bash

AWKS='/MemTotal/   {mtotal=$2};
/MemFree/    {mfree=$2};
/Active/     {mactive=$2};
/^Cached/     {mcached=$2};
/SwapTotal/  {swtotal=$2};
/SwapFree/   {swfree=$2};
END {
    print mtotal-mfree " " mtotal;
    print mactive " " mtotal;
    print mcached " " mtotal;
    print swtotal-swfree " " swtotal; }'

echo "$AWKS"
#while echo ' ^tw()Mem:
#Active:
#Cached:
#Swap  : ' | paste -d ' ' - < (awk "$AWKS" /proc/meminfo | gdbar -fg '#aecf96' -bg '#37383a' -w 50 -h 7); do
#sleep 5
#done