weWe have linuxa Linux machine with 32G
we. We capture the mem as the follwingas follows:
mem=` cat /proc/meminfo | grep MemTotal | awk '{print $2}' ` echo $mem 32767184 and now we convert it to GIGA:
mem_in_giga=` echo $(( $mem / 1024 / 1024)) ` echo $mem_in_giga 31 but from the results we get 31 and not 32G.
theThe same story with freethe free command:
free -g total used free shared buff/cache available Mem: 31 9 17 0 4 20 Swap: 7 0 7 soSo how todo we get the 32G by"32G" from any command solution?