Raspberry Pi

How to find serial number of Raspberry Pi

If you are a Raspberry Pi user, you will probably need help in finding the serial number of your Raspberry Pi because you won’t find it on your Raspberry Pi device. Serial number of a device is a unique identifier and normally a difficult job to find it. However, you don’t need to worry now because through Raspberry Pi commands, you are able to find the serial number of your Raspberry Pi device.

There are different commands which are used to get the serial number of your Raspberry Pi device and this article will tell you those commands.

How to find serial number of Raspberry Pi

Here, you will get to know the three commands which are used to find the serial number of your Raspberry Pi device and you only need to enter these commands in the terminal and you will get output which includes your device serial number.

1: Finding serial number through cat command

Your device serial number is hidden in the “/sys/firmware/device tree/base/serial-number/” file and in order to access it, you will need to use the “cat” command with the location where the file that contains serial number is hidden and it will show you the content of the file. The below commands are used to find the serial number of your Raspberry Pi.

$ cat /sys/firmware/devicetree/base/serial-number

When you press Enter after adding the above command, you will get the serial number as an output on your Raspberry Pi terminal as shown below.

2: Finding Serial Number through /proc/cpuinfo file

There is another file where you can get the serial number of your Raspberry Pi device which is the “/proc/cpuinfo” file. As your Raspberry Pi device is basically a CPU so you will find all the information including your serial number as well by entering the below command in the terminal.

$ cat /proc/cpuinfo

There is another command which can be used only to get the serial number of the Raspberry Pi device and that command is similar to the above “cat proc/cpuinfo” command except you will need to add “| grep Serial | cut -d ‘ ‘ -f 2” after the command and you will get only the serial number of your Raspberry Pi device as an output in the terminal.

$ cat /proc/cpuinfo | grep Serial | cut -d ' ' -f 2

Conclusion

Raspberry Pi devices come with a unique serial number, finding hardware serial number is important for number of reasons. Through the above commands, you will easily find the serial number of Pi as you won’t find it on your Raspberry Pi device. Running the commands on your Raspberry Pi is quite a simple and straightforward task for you. These are the easiest methods to get the serial number of your Raspberry Pi device.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.