Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I forgot how many RAM modules are installed on my laptop. I do not want to unscrew it but want to look it up on the console using bash. How do I gather this information?

share|improve this question

3 Answers 3

up vote 38 down vote accepted

Since you don't mention, I'm assuming this is on Linux.

dmidecode -t memory
dmidecode -t 16
lshw -class memory
share|improve this answer
+1 for dmidecode which is awesome. I would also add the correct number 16 instead of 6 + sudo. –  user13742 Mar 2 '12 at 17:34
@hesse Ah yes, 6 was a mistype. Thanks for the correction. –  Chris Down Mar 2 '12 at 17:40
lshw did the trick. –  k0pernikus Mar 2 '12 at 22:36

Let's make it easy for Ubuntu (and maybe other distros') users:

sudo dmidecode -t memory | grep -i size

The output on my laptop would be:

Size: 2048 MB
Size: 1024 MB

...showing that I have one 1GB module and one 2GB module installed.

share|improve this answer

In my case,

#dmidecode -t 16

reports this:

Handle 0x000A, DMI type 16, 23 bytes
Physical Memory Array
        Location: System Board Or Motherboard
        Use: System Memory
        Error Correction Type: None
        Maximum Capacity: 16 GB
        Error Information Handle: Not Provided
        Number Of Devices: 2

I would like to point out that I have only 4 GiB of RAM in one module. That info is shown by doing:

 # dmidecode -t 17

this is shown:

# dmidecode 2.11
SMBIOS 2.7 present.

Handle 0x000B, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x000A
    Error Information Handle: Not Provided
    Total Width: Unknown
    Data Width: Unknown
    Size: No Module Installed
    Form Factor: DIMM
    Set: None
    Locator: ChannelA-DIMM0
    Bank Locator: BANK 0
    Type: Unknown
    Type Detail: None
    Speed: Unknown
    Manufacturer: Not Specified
    Serial Number: Not Specified
    Asset Tag: None
    Part Number: Not Specified
    Rank: Unknown
    Configured Clock Speed: Unknown

Handle 0x000C, DMI type 17, 34 bytes
Memory Device
    Array Handle: 0x000A
    Error Information Handle: Not Provided
    Total Width: 64 bits
    Data Width: 64 bits
    Size: 4096 MB
    Form Factor: SODIMM
    Set: None
    Locator: ChannelB-DIMM0
    Bank Locator: BANK 2
    Type: DDR3
    Type Detail: Synchronous
    Speed: 1600 MHz
    Manufacturer: Hynix/Hyundai
    Serial Number: 11111111
    Asset Tag: None
    Part Number: HMT351S6CFR8C-PB  
    Rank: Unknown
    Configured Clock Speed: 1600 MHz

And, as you can see, Bank 2 is full and Bank 0 empty. Board has only two slots for RAM, but they have to be double channel.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.