dmidecode command in Linux Explained [with Examples]

Written by: Bobbin Zachariah   |   Last updated: December 9, 2023

dmidecode is a command-line tool in Linux to retrieve detailed information about your computer's hardware components (such as motherboard, CPU, memory, BIOS) and system firmware. It provides a structured and human-readable output, to understand hardware configuration.

The dmidecode tool reads information from the DMI (Desktop Management Interface) tables, which are often referred to as SMBIOS (System Management BIOS) tables. These tables are a standardized way for the system firmware (usually the BIOS or UEFI) to provide information to the operating system about the system's hardware.

Installing dmidecode

If dmidecode utility is not found installed, you can easily install using the package manager of the Distro.

Debian / Ubuntu
sudo apt install dmidecode
Fedora
sudo dnf install dmidecode
Redhat
sudo yum install dmidecode
Arch Linux
sudo pacman -S dmidecode

Basic Usage

When you run dmidecode without any options or arguments, it typically displays the full DMI data, which includes information about various hardware components and system settings.

sudo dmidecode
run dmidecode command

This can be quite extensive, so it's often best to narrow down the output by specifying a DMI type with the -t option.

sudo dmidecode --type bios
or
sudo dmidecode -t bios
or
sudo dmidecode -t 0 ### You can use the -t option followed by the DMI type code

Alternatively, you can use a specific string keyword from the DMI data to retrieve information, you can use the -s option followed by the keyword you're interested in.

sudo dmidecode -s system-manufacturer
dmidecode using string keyword system-manufacturer

Common dmidecode Options:

  • -t or --type: Specifies the type of information to retrieve.
  • -s or --string: Retrieves a specific string field.
  • -u or --dump: Dumps the full DMI data to a file for further analysis.
  • -q or --quiet: Suppresses verbose output.

Examples of dmidecode Usage

1. Checking System Information

sudo dmidecode -t system
dmidecode checking system information

2 Examining Memory Information

sudo dmidecode -t memory
dmidecode get memory information

To filter the information you need you can pipe the output to other commands or use grep. Example:

sudo dmidecode -t memory | grep Size
        Size: 4 GB

Alternatively, you can use the following command to identify installed DIMMs:

sudo dmidecode -t 17

3. Retrieving CPU Details

sudo dmidecode -t processor
dmidecode type processor

You can confirm so by noting the processor type. In this case, it’s highlighted as core i5.

4. Investigating BIOS/Firmware Details

sudo dmidecode -t bios
dmidecode bios information

Alternatively, use -s option with strings keyword such as bios-version, bios-release-date, and bios-vendor.

Example:

sudo dmidecode -s bios-version

5. Get system cache information

sudo dmidecode -t 7
or
sudo dmidecode -t cache
dmidecode showing cache information

You can retrieve information about the L1 and L2 caches, including their sizes, configuration, operational mode, and more.

6. Retrieve system's serial number

sudo dmidecode -s system-serial-number

Running this command will display the serial number of your system, if it's available in the DMI data.

You may also find from the system information by using sudo dmidecode -t 1.

7. Get motherboard information

sudo dmidecode -t 2
or
sudo dmidecode -s baseboard-product-name

8. Displaying UUID

dmidecode | grep UUID

###on AWS this helps to determine system is EC2.
sudo dmidecode --string system-uuid 

Note: Depending on the SMBIOS version presented to it by the virtual machine's hardware version, dmidecode may display the UUID differently. Also, the format of the UUID in SMBIOS data may change between different SMBIOS versions or hardware versions.

dmidecode Type

Here list of DMI types for dmidecode:

TypeInformation
0BIOS
1System
2Baseboard
3Chassis
4Processor
5Memory Controller
6Memory Module
7Cache
8Port Connector
9System Slots
10On Board Devices
11OEM Strings
12System Configuration Options
13BIOS Language
14Group Associations
15System Event Log
16Physical Memory Array
17Memory Device
1832-bit Memory Error
19Memory Array Mapped Address
20Memory Device Mapped Address
21Built-In Pointing Device
22Portable Battery
23System Reset
24Hardware Security
25System Power Controls
26Voltage Probe
27Cooling Device
28Temperature Probe
29Electrical Current Probe
30Out-of-band Remote Access
31Boot Integrity Services
32System Boot
3364-bit Memory Error
34Management Device
35Management Device Component
36Management Device Threshold Data
37Memory Channel
38IPMI Device
39Power Supply
40Additional Information
41Onboard Devices Extended Information
42Management Controller Host Interface

About The Author

Bobbin Zachariah

Bobbin Zachariah

Bobbin Zachariah is an experienced Linux engineer who has been supporting infrastructure for many companies. He specializes in Shell scripting, AWS Cloud, JavaScript, and Nodejs. He has qualified Master’s degree in computer science. He holds Red Hat Certified Engineer (RHCE) certification and RedHat Enable Sysadmin.

SHARE

Comments

Please add comments below to provide the author your ideas, appreciation and feedback.

Leave a Reply

Leave a Comment