How to get the total physical memory in Bash to assign it to a variable? April 19, 2023 by Tarik grep MemTotal /proc/meminfo | awk '{print $2}' The returned number is in KB