I have a following question from this question. Is the value of the total physical memory always shown in KB? Because I would like to print it in GB and I use this command
grep MemTotal /proc/meminfo | awk '{$2=$2/(1024^2); print $2}'
I'm not sure wheter I should add a if statement to prove the command grep MemTotal /proc/meminfo showing KB value or other value
Any help would be appreciated