Last active
December 15, 2015 14:29
-
-
Save letsspeak/5274875 to your computer and use it in GitHub Desktop.
centos memory usage one liner
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
// memory usage percent (integral) | |
free | awk 'NR==2' | awk '{print int($3/$2*100)}' | |
// actual memory usage (integral) | |
// http://open-groove.net/linux-command/free/ | |
free | awk 'NR==2' | awk '{print int(($3-($6+$7))/$2*100)}' | |
// swap memory usage percent (integral) | |
free | awk 'NR==4' | awk '{print int($3/$2*100)}' | |
// total memory usage percent (integral) | |
free -t | awk 'NR==5' | awk '{print int($3/$2*100)}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment