diff options
author | Thomas Debesse <dev@illwieckz.net> | 2016-04-29 12:44:45 +0200 |
---|---|---|
committer | Thomas Debesse <dev@illwieckz.net> | 2016-04-29 12:47:10 +0200 |
commit | 14b8e3299e0ea3c382776f92a45fc9ce7fae8e4c (patch) | |
tree | 813ea4ef5c6f11f188d07fdaac7e5e535f0966a3 | |
parent | 92289c867458f15132a5ed446cd300f94bce6bee (diff) |
use MemAvailable as mem_free (exclude cached memory)
-rwxr-xr-x | sysinfo.sh | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -10,7 +10,7 @@ uptime=`uptime | sed -e 's/[ ][ ]*/ /g;s/ [0-9:]* up \(.*\), [0-9]* user.*/\1/'` #--- [ MEMORY ] ----------------------- mem_total=`cat /proc/meminfo | grep -i MemTotal | awk '{printf "%d",$2/1024;}'` -mem_free=`free | tail -n2 | head -n1 | sed 's/^.*://' | awk '{printf "%d",$2/1024;}'` +mem_free=`cat /proc/meminfo | grep -i MemAvailable | awk '{printf "%d",$2/1024;}'` mem_used=`echo ${mem_total} ${mem_free} | awk '{printf "%d",$1-$2;}'` swap_total=`cat /proc/meminfo | grep -i SwapTotal | awk '{printf "%d",$2/1024;}'` |