Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-25-2004, 03:33 AM
|
#1
|
LQ Newbie
Registered: Mar 2004
Location: Bangalore
Posts: 26
Rep:
|
Linux/Unix Command to find RAM size?
Is there any single command to find out RAM size on the m/c?
-ssnkumar
|
|
|
03-25-2004, 03:41 AM
|
#2
|
Member
Registered: Jul 2003
Distribution: FreeBSD 8.2 RELEASE
Posts: 607
Rep:
|
cat /proc/meminfo on my machine.
|
|
|
03-25-2004, 04:38 AM
|
#3
|
LQ Newbie
Registered: Mar 2004
Location: Bangalore
Posts: 26
Original Poster
Rep:
|
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
|
|
|
03-25-2004, 04:54 AM
|
#4
|
Senior Member
Registered: Dec 2002
Location: Atlantic City, NJ
Distribution: Ubuntu & Arch
Posts: 3,503
Rep:
|
dmesg | grep Memory
but that prints out other info as well. Are you using this in a script?
|
|
|
03-25-2004, 04:58 AM
|
#5
|
Member
Registered: Jun 2003
Location: Dublin, Ireland
Distribution: Slackware, LFS, Ubuntu, RedHat, Slamd64
Posts: 507
Rep:
|
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
|
|
|
03-25-2004, 05:10 AM
|
#6
|
LQ Newbie
Registered: Mar 2004
Location: Bangalore
Posts: 26
Original Poster
Rep:
|
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
|
|
|
03-25-2004, 05:33 AM
|
#7
|
Member
Registered: Feb 2004
Distribution: Debian
Posts: 286
Rep:
|
There is no such command. jkobrien's suggestion works beautifully, though. I suggest you stick to it.
|
|
|
03-25-2004, 06:01 AM
|
#8
|
Senior Member
Registered: Apr 2003
Location: Germany
Distribution: openSuSE Tumbleweed-KDE, Mint 21, MX-21, Manjaro
Posts: 4,637
Rep:
|
shows the usage of your RAM. I don't know whether an option exists to extract only the total amount physical memory. might help .
|
|
|
03-25-2004, 06:47 AM
|
#9
|
LQ Newbie
Registered: Mar 2004
Location: Bangalore
Posts: 26
Original Poster
Rep:
|
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
|
|
|
09-09-2009, 10:38 AM
|
#10
|
LQ Newbie
Registered: Oct 2008
Posts: 2
Rep:
|
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:09 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|