CH4
CH4

Reputation: 105

How to get serial number or UUID of a PC on Linux?

In windows OS, we can get Serial Number in BIOS by querying WMI to identify a unique machine. Do we have any way to do this in Linux OS in C++? Do we have any API to do this? Thanks in advance!

Upvotes: 1

Views: 3802

Answers (2)

Chudeusz
Chudeusz

Reputation: 1

Run as root (Ubuntu/Debian):

cat /sys/class/dmi/id/product_uuid

Upvotes: 0

SimoX
SimoX

Reputation: 368

You can use the Terminal. For example, in Ubuntu, you can launch this command:

sudo dmidecode –type system

The required info are in the System Information section.

P.S. you must have root privileges

Upvotes: 1

Related Questions