There are several ways to find the number of RAM slots in a Linux system. One of the most common methods is to use the dmidecode
command, which retrieves hardware information from the BIOS.
- Open a terminal window and run the following command:
sudo dmidecode -t memory
This will display information about the memory installed in the system, including the number of RAM slots and the amount of memory in each slot.
- Look for the “Number Of Devices” in the output, this is the number of RAM slots.
Handle 0x0035, DMI type 16, 23 bytes
Physical Memory Array
Location: System Board Or Motherboard
Use: System Memory
Error Correction Type: None
Maximum Capacity: 64 GB
Error Information Handle: Not Provided
Number Of Devices: 4
Another option is to use the lshw
command, it gives a detailed information about the system’s hardware.
sudo lshw -class memory
This command will give you a detailed information about the memory of the system, including the number of RAM slots and the amount of memory in each slot.
You can also use the lspci
command for RAM slots information, this command shows the information about the PCI buses and devices in the system.
sudo lspci -v | grep -A7 -i "memory"
You can also use lshw
command with -short
option to get less verbose and more concise output.
sudo lshw -short -class memory
This command will provide you a brief information about the number of RAM slots and the amount of memory in each slot.