View the Server Total Ram in GB

Hello,

I want to view server RAM in GB i.e 4 GB or 6 GB via command line to use it in bash script

waiting Any Ideas :slight_smile:

Thanks :):slight_smile:

Its platform dependant...

cat /proc/meminfo
MemTotal: 255944 kB
........
divide this by (1024 * 1024) to get GB

or use free -m
total used free shared buffers cached
Mem: 249 240 9 0 62 81
-/+ buffers/cache: 96 153
Swap: 400 33 366
sptmw01@mwvm01:~$