All pastes #370029 Raw Edit

Someone

public shellscript v1 · immutable
#370029 ·published 2007-02-24 05:33 UTC
rendered paste body
#!/bin/sh## a script to simply display the accurate memory usage for the linux system.# gnu-gpl feel free to copy edit or any any other change use or abuse this code,# so long as you don't try to claim ownership thereof to the exclusion of the# rights of others to use, and do the same with it.   thank you !#mem=(`cat /proc/meminfo | tr -d "[A-z] :" | tr "\n" " " | cut -d' ' -f-4`)memused="$((( ${mem[0]} - ${mem[1]} - ${mem[2]} - ${mem[3]} ) / 1024))"memtotal="$(( ${mem[0]} / 1024))"memper="$((( $memused * 100 ) / $memtotal ))"echo "Mem usage: $memused/$memtotal MB ($memper%)"