nix, shell, perl, php, mysql and mac os x tips and tricks

Tuesday, November 10, 2009

Grab the load average as a usable number

uptime | awk -F "load average: " '{ print $2 }' | cut -d, -f1
another way:
uptime | awk '{print $8}' | cut -d "," -f 1
yet another:
uptime | sed -e "s/^.*[a-z]: //; s/,.*//"

No comments:

Post a Comment