How to find serial number of computer in Linux using dmidecode

To find the serial number of the computer, open a terminal window and install dmidecode using apt-get as below:
$ sudo apt-get install dmidecode <enter>

Thereafter, enter the following command to get the serial number:
$ sudo dmidecode | grep -i serial <enter>

Now you will see the serial number of the computer. The serial number is also called the service tag.