Skip to content

Instantly share code, notes, and snippets.

@aduzsardi
Created January 10, 2018 09:55
Show Gist options
  • Save aduzsardi/deeaaf9630e2e5776a1545429efdad69 to your computer and use it in GitHub Desktop.
Save aduzsardi/deeaaf9630e2e5776a1545429efdad69 to your computer and use it in GitHub Desktop.
percentage available memory linux os
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