cat /proc/meminfo | grep -E 'MemTotal|MemAvailable|SwapTotal'
Category: Self-Hosting
cat /proc/meminfo | grep -E 'MemTotal|MemAvailable|SwapTotal'
Check total RAM, available RAM, and swap size from the kernel's memory stats
Reads memory stats directly from the kernel. MemAvailable is more useful than MemFree — it includes memory that can be freed from caches on demand.