What
is the Dmidecode Command?
The dmidecode stands for Desktop Management Interface Table decoder is a very handy tool for Linux
administrators to retrieve detailed information about the system’s hardware
components. It is used to convert the system’s DMI table into a human-readable
format.
It allows administrators and users to see information about the
system's hardware components configuration. This tool provides information
about the processor, memory, BIOS, board and other components etc.
Why Use the dmidecode Command?
When
you need some information about your system hardware component on an urgent basis, then dmidecode is in place to solve this problem. No need to access the system
components physically to retrieve the hardware information. It displays the
current system configuration and maximum information of the system, such as CPU
support and memory. This is commonly used to ensure the hardware specifications
for inventory purposes and hardware upgrades.
Dmidecode commands
Syntax:
#sudo dmidecode [options]
Note:
some Linux or UNIX system needs root permissions to run dmidecode commands. For
running these commands, sudo can grant such permissions. 1. DMI Version
To check the current version
of the dmidecode command is
#sudo dmidecode --v
or
#sudo dmidecode -V
2. Dmidecode Help Command
The help command shows the summary of all the available options and their usage.
#sudo
dmidecode --help
3. Simple Dmidecode Command
This command shows all the DMI
information.
#sudo dmidecode
This
command provides complete output of all the available DMI information including
various hardware components. To
see the information in a presentable way use more option with the dmidecode
command.
#
sudo dmidecode | more
DMI Types
The -t or --type option is used to
filter the output for the specific DMI types. To see the supportive types just
issue dmidecode command with --type.
#sudo dmidecode -t or --types
Common Types
4. Dmidecode BIOS Information
To display the BIOS information command
is
#sudo dmidecode -t bios
or
#sudo dmidecode --type bios
DMI
type ID can also be used to fetch BIOS information. Both commands display the
same BIOS information.
#sudo
dmidecode -t 0
5. Dmidecode Board Information
To display the baseboard information
command is
#sudo dmidecode -t baseboard
or
#sudo dmidecode -t 2
6. Dmidecode Processor Information
To display the processor information
command is
#sudo dmidecode -t processor
or
#sudo dmidecode -t
7. Dmidecode Memory Information
To display the information about
Physical Memory and DIMMs, run the following command
#sudo dmidecode -t memory
or
#sudo dmidecode -t 6
8. Dmidecode Chassis Information
To
display chassis information command is
#dmidecode
-t chassis
or
#dmidecode
-t 3
9. Dmidecode System Information
To get the system information command is
#sudo dmidecode -t system
or
#sudo dmidecode -t 1
10. Dmidecode Cache Information
To
check the cache information command is
#sudo
dmidecode -t cache
or
#sudo
dmidecode -t 7
11. Dmidecode Connector Information
To
check the connector information command is
#dmidecode
-t connector
or
#dmidecode
-t 8
12. Dmidecode Slot Information
To
check the slot information command is
#sudo
dmidecode -t slot
or
#sudo
dmidecode -t 9
Information using Dmidecode Keywords
String
keyword is also an available option to get the information about any system
component. Its syntax is
#sudo
dmidecode -s or sudo dmidecode --string
If
only -s option is used without any DMI keyword, it shows all the available valid
keywords with an error message.
13. Bios Vendor Check
To
check the BIOS vendor command is
#sudo dmidecode -s bios-vendor
14. BIOS Release Date
To
check the BIOS release date command is
#sudo
dmidecode -s bios-release-date
15. Check BIOS Version
To
check the BIOS version command is
#sudo
dmidecode -s bios-version
16. Check System Manufacturer Information
To
check the system manufacturer information command is
#sudo dmidecode -s system-manufacturer
17. Check System Product Name
To
check the system product name command is
#sudo
dmidecode -s system-product-name
18. Check Processor Version
To
check the processor version command is
#sudo
dmidecode -s processor-version
19. Check Processor Manufacturer
To
check the manufacturer of the processor command is
#sudo
dmidecode -s processor-manufacturer
20. Check Baseboard Product Name
To
check the name of the baseboard command is
#sudo
dmidecode -s baseboard-product-name
How to Hide Information in Output
To
hide some information in the output of the dmidecode, you need to enable quiet
mode. For this purpose, use the -q switch with the dmidecode command. For example, to display the system information, use the dmidecode command with -q --quiet switch.
#sudo
dmidecode -qt system
Information as Hexadecimal
To
display the information in hexadecimal and ASCII, run the dmidecode command
with -u switch.
#sudo
dmidecode -ut memory
How to dump DMI information in a File
To
dump the DMI information in the file command is
#sudo
dmidecode --dump-bin testfile
How to Retrieve DMI Data from the Binary
File
To
retrieve the DMI data from the test file that is created with the --dump-bin option,
this command is used.
#sudo
dmidecode --from-dump testfile
Multiple components Information
To
retrieve the multiple components' information with one command, dmidecode is
used with the grep or egrep switch. Commands can be combined with pipes and
specify multiple patterns with grep.
Use grep to get Multiple Patterns
To
get multiple information about the system, use grep with the dmidecode command.
#sudo
dmidecode -t system | grep -E ‘Manufacturer|Product Name| Serial Number’
This
command will show the information about the manufacturer, product name and
serial number from the system section.
How to Get Memory Type
To
display information about which type of memory is installed with grep command
as DDR3, DDR4. Here T will be capital in -m2 Type.
#sudo
dmidecode -t memory |grep -m2 Type
Different types of Information
Different
types of information output can be combined using grep with the dmidecode
command, for example, to display the information about the system, processor and
memory the command is
#
(sudo dmidecode -t system; sudo dmidecode -t processor; sudo dmidecode -t
memory) | grep -E 'Manufacturer|Version|Size'
Troubleshooting dmidecode Errors
While using the dmidecode command, you might encounter some
common errors. Below are their causes and fixes:
Permission
denied
This error occurs when the command is executed without
administrative privileges.
Fix: Run the command with sudo — for example:
#sudo
dmidecode -t system
SMBIOS not found
This means the system hardware doesn’t
expose SMBIOS data or your platform doesn’t support DMI tables (common on some
ARM-based systems or older machines).
Fix: Check if your hardware supports
SMBIOS, or run the command on a different system.
dmidecode:
command not found
This error appears when the dmidecode utility isn’t
installed on your Linux system.
Fix: Install it
using your distribution’s package manager:
For Debian/Ubuntu:
#sudo apt install dmidecode
For RHEL/CentOS/Fedora:
#sudo yum install dmidecode
Empty
or Incomplete Output in Virtual MachinesIn some virtualized environments, DMI
information is partially hidden for security reasons.
Fix: Some hypervisors, such as VMware or KVM, may
mask SMBIOS data. You can check the VM settings or try running the command on a
physical host for complete details.
Once your server hardware and configuration are verified, securing the remote access is an important step. Follow our guide on How to Secure SSH Access on Linux.
Practical Use Cases for dmidecode
· Asset inventory automation
· Firmware audit before BIOS update
· Server documentation
· Troubleshooting hardware mismatches
Frequently Asked Questions (FAQs)
1. What is dmidecode used for in Linux?
The `dmidecode` command is used to display hardware information directly
from the system’s DMI (Desktop Management Interface) tables. It provides
details such as BIOS version, motherboard model, processor type, memory slots,
and system serial numbers without requiring physical access to the hardware.
2. Can dmidecode run without root
privileges?
No,
most systems require administrative privileges to access the DMI tables. You
should use `sudo` with dmidecode to retrieve complete hardware details.
3. Why does dmidecode show “permission
denied”?
This
error occurs when you try to execute dmidecode without `sudo` or root access.
Simply prefix the command with `sudo` and enter your password to resolve the
issue.
4. Is it safe to run dmidecode on
production systems?
Yes, dmidecode is a read-only command that doesn’t modify system data or
hardware configurations. It’s completely safe to use even on production servers
for hardware inventory and diagnostics.
Final
Thoughts
The dmidecode command is a useful tool
in the toolkit of every Linux administrator. It gives deep insights of hardware
information without requiring you to open the system physically. From checking
the BIOS version to serial number, to identifying memory slots to manufacturer
details, dmidecode helps to streamline hardware audits, troubleshooting and
system documentation.
Always run this command with the appropriate permissions
or as a root user and be careful when using this information for the automated
scripts. As a Linux administrator, understanding and using dmidecode
effectively can save your time, reduce hardware-related guesswork and enhance
your ability to manage Linux systems confidently.
If you found this guide helpful, don't forget to share and subscribe SeekLinux for more updates and Linux administration tips.
Post a Comment