Get RAM Details on Linux

Get RAM Details on Linux

Random Access Memory (RAM) is important for systems, temporarily storing data actively used by the CPU. Knowing how to check RAM details on Linux is beneficial for troubleshooting hardware issues, planning an upgrade, or just curious about the system's specifications. This tutorial demonstrates how to get RAM details on Linux.

Run the following command to retrieve RAM details, including size, device locator, speed, manufacturer, and part number:

sudo dmidecode -t memory | awk '/Memory Device/{i++;print "Device "i} /\tSize|\tLocator|\tSpeed|\tManufacturer|\tPart Number/'

Here's an example of what the output might look like:

Device 1
    Size: No Module Installed
    Locator: Controller0-DIMMA1
    Speed: Unknown
    Manufacturer: Not Specified
    Part Number: Not Specified
Device 2
    Size: 48 GB
    Locator: Controller0-DIMMA2
    Speed: 6400 MT/s
    Manufacturer: G Skill Intl
    Part Number: F5-6400J3239F48G    
Device 3
    Size: No Module Installed
    Locator: Controller1-DIMMB1
    Speed: Unknown
    Manufacturer: Not Specified
    Part Number: Not Specified
Device 4
    Size: 48 GB
    Locator: Controller1-DIMMB2
    Speed: 6400 MT/s
    Manufacturer: G Skill Intl
    Part Number: F5-6400J3239F48G

In our case, Device 1 and Device 3 have no modules installed, whereas Device 2 and Device 4 have 48 GB memory modules.

Let's break down command step by step:

  • dmidecode - this command is used to retrieve information about the system's hardware from the DMI table.
  • -t memory - this option specifies that we want to focus on memory-related information.
  • awk - is a text processing tool on Linux used for pattern scanning and processing.
  • /Memory Device/{i++;print "Device "i} - this part searches for lines that contain the pattern Memory Device and for each match, it increments a counter i and prints Device followed by the incremented number.
  • /\tSize|\tLocator|\tSpeed|\tManufacturer|\tPart Number/ - this part searches for lines containing patterns such as Size, Locator, Speed, Manufacturer, and Part Number preceded by tabs (represented by \t). It will print these lines, effectively extracting information about the memory device's size, locator, speed, manufacturer, and part number.

Leave a Comment

Cancel reply

Your email address will not be published.