dmidecode: Get System Hardware Information On Linux

Dmidecode is a Linux command-line tool used to retrieve information about your system's hardware components in a human-readable format.

What is the dmidecode Command in Linux?

Dmidecode reads the data from DMI (Desktop Management Interface)ย table, which holds information for the system’s hardware components like BIOS Revision, Serial Number, RAM, CPU, manufacturer information, etc. In other words, it acts as a decoder of the DMI table.

Dmidecode Use Cases

For example, you might run into situations where you need to find out the maximum RAM supported by the BIOS and motherboard, a serial number, or an essential piece of hardware information during troubleshooting.

So, rather than looking up hardware specs in a manual, you could instantly use the dmidecode command to grab this information.

How to Install dmidecode

Dmidecode comes pre-installed with most Linux distributions. However, if it is not installed already, you can install it using your distribution’s package manager.

Ubuntu / Debian / Linux Mint

sudo apt install dmidecode

Fedora / Cent OS / Alma Linux

sudo yum install dmidecode

openSUSE

sudo zypper in dmidecode

Arch Linux / Manjaro

sudo pacman -S dmidecode

DMI Types

To use dmidecode effectively, you need to know about the types of DMI and its keywords to play well without any problems. The specification defines the following DMI types.

TypeInformationTypeInformation
0BIOS21Built-in Pointing Device
1System22Portable Battery
2Base Board23System Reset
3Chassis24Hardware Security
4Processor25System Power Controls
5Memory Controller26Voltage Probe
6Memory Module27Cooling Device
7Cache28Temperature Probe
8Port Connector29Electrical Current Probe
9System Slots30Out-of-band Remote Access
10On-Board Devices31Boot Integrity Services
11OEM Strings32System Boot
12System Configuration Options3364-bit Memory Error
13BIOS Language34Management Device
14Group Associations35Management Device Component
15System Event Log36Management Device Threshold Data
16Physical Memory Array37Memory Channel
17Memory Device38IPMI Device
1832-bit Memory Error39Power Supply
19Memory Array Mapped Address40Additional Information
20Memory Device Mapped Address41On-board Device

Keywords can be used instead of type numbers with --type or -t flags to pull all associated type codes into the command. Each keyword is equivalent to a list of type numbers. Following is the list of available keywords.

KeywordTypes
bios0
system1, 12, 15, 23, 32
baseboard2, 10, 41
chassis3
processor4
memory5, 6, 16, 17
cache7
connector8
slot9

How to Use the dmidecode Command

In the dmidecode command, we can use either keyword or type id to get hardware information of the system. Note that you need to execute commands as a root user or one with sudo privileges to get this information.

Get Memory Information in Linux

To get all memory information details, run dmidecode with the -t option below.

sudo dmidecode -t memory
Get Memory Information in Linux Using the dmidecode Comm

You can further filter details with the egrep command to filter only the required information.

sudo dmidecode -t memory | egrep "Maximum Capacity|Number Of Devices|Size|Type:" | egrep -v "No Module|Unknown|None"Code language: JavaScript (javascript)
Get Memory Information in Linux Using the dmidecode Command

Get CPU Information in Linux

To get processor information, use the following command.

sudo dmidecode -t processor
Get CPU Information in Linux Using the dmidecode Command

You can further filter details with the egrep command to filter only the required details.

sudo dmidecode -t processor | egrep "Family|Manufacturer|Version|Max Speed|Core Count|Thread Count"Code language: JavaScript (javascript)
Get CPU Information in Linux Using the dmidecode Command

Get Hardware Information on BIOS in Linux

To get the BIOS version, vendor, and other details, use the -t bios option.

sudo dmidecode -t bios
Get Hardware Information on BIOS in Linux Using the dmidecode Command

Get the System Information in Linux

Run the dmidecode command with the -t option followed by the system keyword to get system information.

sudo dmidecode -t system
Get the System Information in Linux Using the dmidecode Command

Get the Motherboard Model in Linux

sudo dmidecode -t baseboard
Getย theย Motherboardย Model inย Linux Using the dmidecode Command

Conclusion

That’s all from this article. Now you know how to use the dmidecode command and its options to get different hardware information. Then, of course, you can try other dmidecode options to obtain the system details you need.

If you want to read more  about dmidecode command you can refer to the official website.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

Think You're an Ubuntu Expert? Let's Find Out!

Put your knowledge to the test in our lightning-fast Ubuntu quiz!
Ten questions to challenge yourself to see if you're a Linux legend or just a penguin in the making.

1 / 10

Ubuntu is an ancient African word that means:

2 / 10

Who is the Ubuntu's founder?

3 / 10

What year was the first official Ubuntu release?

4 / 10

What does the Ubuntu logo symbolize?

5 / 10

What package format does Ubuntu use for installing software?

6 / 10

When are Ubuntu's LTS versions released?

7 / 10

What is Unity?

8 / 10

What are Ubuntu versions named after?

9 / 10

What's Ubuntu Core?

10 / 10

Which Ubuntu version is Snap introduced?

The average score is 68%