The below shell command can be used to check the amount of RAM in Ubuntu Linux.
$ dmesg | grep -in available | grep -in memory
The above command will show output similar to below line
3:150:[ 0.000000] Memory: 943092K/1044960K available
This line shows the amount to RAM installed on the system and usable RAM in Kilobytes.