Created
January 10, 2018 09:55
-
-
Save aduzsardi/deeaaf9630e2e5776a1545429efdad69 to your computer and use it in GitHub Desktop.
percentage available memory linux os
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
awk -v memt=$(grep -E 'MemTotal:' /proc/meminfo | awk '{print $2}') -v mema=$(grep -E 'MemAvailable:' /proc/meminfo | awk '{print $2}') "BEGIN {printf \"%.2f\n\", (mema/memt)*100}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment