#!/usr/bin/env bash
awk '
	/^MemTotal:/ {
        mem_total=$2 / 1024 / 1024
	}
	/^MemAvailable:/ {
	    mem_free=$2 / 1024 / 1024
	}
	END {
	    mem_used=mem_total-mem_free

	    mem_pct=mem_used/mem_total*100
	    printf("MEM %.1fGib/%.1fGib (%.f%%)\n", mem_used, mem_total, mem_pct)
	}
' /proc/meminfo
