Linux/Unix Command to find RAM size?
Is there any single command to find out RAM size on the m/c?
-ssnkumar |
cat /proc/meminfo on my machine.
|
This prints out many other info also. But, I want only ram size.
So, is there any other command which returns only ram size? -ssnkumar |
dmesg | grep Memory
but that prints out other info as well. Are you using this in a script? |
cat /proc/meminfo | awk 'match($1,"MemTotal") == 1 {print $2}'
But I don't know if the format of /proc/meminfo varies among distribution. John |
Thanks for all the suggestions...
All these are trying to access proc file system info or from somewhere else and is printing on to the screen. But, what I am asking for is a command (standard) which prints only the required info. For example, to know the architecture of my computer I can use arch command. To know the hostname I can use that command. In the same way, for ram size....? -ssnkumar |
There is no such command. jkobrien's suggestion works beautifully, though. I suggest you stick to it.
|
Code:
free Code:
man free |
Thanks for the help guys.
All your suggestions are working fine on Linux. I don't know if they work on other Linux flavors also (I think they will). Thanks ssnkumar |
dmidecode
Only about 4 years late, but for Googlers, like me...
There is in fact a command to show the memory hardware (even at the time this thread was still active). The command you were looking for was: dmidecode Amongst other info from the BIOS, it will show the Physical Memory Array with the maximum memory the system can hold, and then each slot, whether its empty or not. Other systems evidently also include a command named 'lshw'. You'll have to use the webpage for lshw, though, because it's not on my systems. thanx, tRaV |
All times are GMT -5. The time now is 04:40 PM. |