Last active
August 29, 2015 14:11
-
-
Save Red5d/189b08942fef5dcedfbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function mempercent { | |
total=$(free -m | sed -n '2p' | awk '{print $2}') | |
used=$(free -m | sed -n '3p' | awk '{print $4}') | |
echo $(echo $(echo 'scale=2;'$used'/'$total'' | bc)*100 | bc | cut -d'.' -f1)"% memory usage (${used}M Used / ${total}M Total)" | |
} | |
function systemload { | |
loadAverage=$(uptime | cut -d',' -f4 | grep -o "[0-9]*\.[0-9]*$") | |
processors=$(cat /proc/cpuinfo | grep processor | tail -n1 | awk '{ print $3 }') | |
let processors=$processors+1 | |
echo "$loadAverage ($processors.00 max)" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment