summaryrefslogtreecommitdiffstats
path: root/bin/mem.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bin/mem.sh')
-rw-r--r--bin/mem.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/bin/mem.sh b/bin/mem.sh
new file mode 100644
index 0000000..decc2fd
--- /dev/null
+++ b/bin/mem.sh
@@ -0,0 +1,21 @@
+#!/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