How to find System Serial number from command line

A simple article on how to find the Serial number or Product number for a given system from the command line on Solaris, HP-UX, AIX, Linux and Windows systems.

Solaris

To get the System Serial number of a system running Solaris (SPARC or x86), run the following:

# prtdiag -v | egrep "Chassis Serial Number"

An alternative is to use the prtpicl command. For example:

# prtpicl -v -c chassis | grep SerialNumber 
:SerialNumber 06******21

We can also use prtconf. For example:

# prtconf -pv | grep chassis
chassis-sn:  'BD******4E'

If your system is managed with ILOM, ALOM, or XSCF, you can query the service processor for the same information. For example:

sc> showplatform
SUNW,SPARC-Enterprise-T5120
Chassis Serial Number: BE******GA

HP-UX

To get System Serial number from command in HP-UX run:

# echo "map;sel dev 1;info;infolog"|cstm|egrep -i "system serial"
 System Serial Number.......: US******VB

AIX

Use the lsattr command on an AIX sytstem to get the System Serial number. For example:

# lsattr -E -l sys0 -a systemid
systemid IBM,01*****1F

An alternative is to use the lsconf command. For example:

# lsconf | grep -e "Machine Serial"
Machine Serial Number: 06***CG

Microsoft Windows

You can find your Windows systems serial number with WMIC command. The WMIC (Windows Management Instrumentation Command) is a command line utility that reads a huge range of information about local or remote computers.

Go to Start > RUN > type CMD and hit Enter to open command prompt.

or press Window + R keys together to open Run command box > Type CMD and hit Enter or click OK button.

In the command prompt type the following:

C:\> wmic bios get serialnumber
SerialNumber
S1***********81

or

C:\> wmic csproduct get identifyingnumber
IdentifyingNumber
CN******JW

Linux - Redhat/SuSE/CentOS/Fedora

To get Serial and Product Number from command in these flavours of Linux, use the dmidesamp commmand. For example:

# sudo dmidecode -t 1 | egrep -i "serial|product"
Product Name: 96***76
Serial Number: L9***88

Linux - Ubuntu

To get the System Serial number from command line on an Ubuntu Server or Unbuntu Desktop, we still use the dmidesamp command with different options. For example:

# sudo dmidecode -s system-serial-number
LX******************BC