OSETC TECH

Linux: Get Serial Number for a Laptop

This post will guide you how to locate the serial number (SN) or model type for a laptop computer in Linux. How do I determine the serial number of a laptop under Linux operating system. How to get the serial number for a Lenovo or HP laptop computer in Linux.

Get Serial Number for a Laptop


If you want to get the serial number for a laptop under Linux system, you can use the dmidecode tool to get the information of the system’s hardware components.

What is Dmidecode?

Dmidecode is a tool for dumping a computer’s DMI (some say SMBIOS) table contents in a human-readable format. This table contains a description of the system’s hardware components, as well as other useful pieces of information such as serial numbers and BIOS revision. Thanks to this table, you can retrieve this information without having to probe for the actual hardware. While this is a good point in terms of report speed and safeness, this also makes the presented information possibly unreliable.

To get the serial number, just type the following command in CLI:

#dmidecode -s system-serial-number

outputs:

[root@osetc_x8664 ~]# dmidecode -s system-serial-number
7135xxxx-5229-d1xx-757f-7bxxx7b06xxx

You can use the dmidecode command to get others hardware information, such as: BIOS-version, BIOS-Vendor, Baseboard information, etc.