redhat

How To Get Computer Serial Number Using CMD Line in Linux

DMIDECODE
Use dmidecode command. If it’s not on the system, install it first.

yum install dmidecode

Now that it’s installed, run it.

dmidecode -t system

Output Example

SMBIOS 2.3 present.

Handle 0x0100, DMI type 1, 25 bytes.
System Information
Manufacturer: HP
Product Name: ProLiant DL380 G4
Version: Not Specified
Serial Number: XXXXXXXXXXX
UUID: XXXXXXX-XXXXX-XXXXXXX-XXXXXXXX-XXXXXXXX
Wake-up Type: Power Switch

Handle 0x2000, DMI type 32, 11 bytes.
System Boot Information
Status: No errors detected

Variations to use instead of "system":

bios
system
baseboard
chassis
processor
memory
cache
connector
slot

How To Get Computer Serial Number Using CMD Line in Windows

This uses WMIC to access your BIOS information where the Serial Number should be present, at least for major brand servers like Dell, HP, and IBM.

I have run this on refurbished HP servers where this information was not entered. Luckily, this was found while it was still on my workbench and I was able to enter the serial number into the BIOS before deploying it out to a remote location.

Open CMD prompt

C:\

Enter:

wmic bios get serialnumber

C:\wmic bios get serialnumber

C:\wmic bios get serialnumber

SerialNumber

{your serial number should display here}