What
is Dmidecode Command?
The dmidecode stands for DesktopManagement 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 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 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 the inventory purposes and the 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. Help Command
Help
command shows the summary of all the available options and their usage.
#sudo
dmidecode --help
3. Simple Dmidecode
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. 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. Board Information
To display the baseboard information
command is
#sudo dmidecode -t baseboard
or
#sudo dmidecode -t 2
6. Processor Information
To display the processor information
command is
#sudo dmidecode -t processor
or
#sudo dmidecode -t
7. 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. Chassis Information
To
display chassis information command is
#dmidecode
-t chassis
or
#dmidecode
-t 3
9. System Information
To get system information command is
#sudo dmidecode -t system
or
#sudo dmidecode -t 1
10. Cache Information
To
check the cache information command is
#sudo
dmidecode -t cache
or
#sudo
dmidecode -t 7
11. Connector Information
To
check the connector information command is
#dmidecode
-t connector
or
#dmidecode
-t 8
12. 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 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
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. Bios Version
To
check the bios version command is
#sudo
dmidecode -s bios-version
16. System Manufacturer Information
To
check the system manufacturer information command is
#sudo dmidecode -s system-manufacturer
17.
System Product Name
To
check the system product name command is
#sudo
dmidecode -s system-product-name
18. Processor Version
To
check the processor version command is
#sudo
dmidecode -s processor-version
19. Processor Manufacturer
To
check the manufacturer of processor command is
#sudo
dmidecode -s processor-manufacturer
20. Baseboard Product Name
To
check the name of 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 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 file command is
#sudo
dmidecode --dump-bin testfile
How to Retrieve DMI Data from the Binary
File
To
retrieve the dmi data from the testfile that is created with --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 identify memory slots to manufacturer
details, dmidecode helps to stream line 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 guess work and enhance
your ability to manage Linux systems confidently.
Keep visiting seeklinux for more updates and information.
Post a Comment