What
is Dmidecode Command?
The dmidecode stands for Desktop Management Interface Table decoder is a very handy facility 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
to 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 for retrieving 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 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'
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.
Keep visiting seeklinux for more updates and information.
Post a Comment