<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Raspberry_Pi%2FSerial_Number</id>
	<title>Raspberry Pi/Serial Number - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://aznot.com/index.php?action=history&amp;feed=atom&amp;title=Raspberry_Pi%2FSerial_Number"/>
	<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Raspberry_Pi/Serial_Number&amp;action=history"/>
	<updated>2026-04-17T02:47:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://aznot.com/index.php?title=Raspberry_Pi/Serial_Number&amp;diff=3501&amp;oldid=prev</id>
		<title>Kenneth at 17:31, 7 July 2016</title>
		<link rel="alternate" type="text/html" href="https://aznot.com/index.php?title=Raspberry_Pi/Serial_Number&amp;diff=3501&amp;oldid=prev"/>
		<updated>2016-07-07T17:31:41Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Serial Number ==&lt;br /&gt;
&lt;br /&gt;
Simple Awk:&lt;br /&gt;
 cat /proc/cpuinfo | grep Serial | awk &amp;#039;{print $3}&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Bash:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cat /proc/cpuinfo | perl -n -e &amp;#039;/^Serial[ ]*: ([0-9a-f]{16})$/ &amp;amp;&amp;amp; print &amp;quot;$1\n&amp;quot;&amp;#039;&lt;br /&gt;
grep -Po &amp;#039;^Serial\s*:\s*\K[[:xdigit:]]{16}&amp;#039; /proc/cpuinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pure Bash:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
pattern=&amp;#039;^Serial.*([[:xdigit:]]{16})$&amp;#039;&lt;br /&gt;
while read -r line&lt;br /&gt;
do&lt;br /&gt;
    if [[ $line =~ $pattern ]]&lt;br /&gt;
    then&lt;br /&gt;
        echo &amp;quot;${BASH_REMATCH[1]}&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
done &amp;lt; /proc/cpuinfo&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Bash Awk:&lt;br /&gt;
 awk &amp;#039;/^Serial\s*:\s/{print $3}&amp;#039; /proc/cpuinfo&lt;br /&gt;
&lt;br /&gt;
Python:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def getserial():&lt;br /&gt;
  # Extract serial from cpuinfo file&lt;br /&gt;
  cpuserial = &amp;quot;0000000000000000&amp;quot;&lt;br /&gt;
  try:&lt;br /&gt;
    f = open(&amp;#039;/proc/cpuinfo&amp;#039;,&amp;#039;r&amp;#039;)&lt;br /&gt;
    for line in f:&lt;br /&gt;
      if line[0:6]==&amp;#039;Serial&amp;#039;:&lt;br /&gt;
        cpuserial = line[10:26]&lt;br /&gt;
    f.close()&lt;br /&gt;
  except:&lt;br /&gt;
    cpuserial = &amp;quot;ERROR000000000&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  return cpuserial&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
References:&lt;br /&gt;
* setup - How do I get the serial number? - Raspberry Pi Stack Exchange - http://raspberrypi.stackexchange.com/questions/2086/how-do-i-get-the-serial-number&lt;/div&gt;</summary>
		<author><name>Kenneth</name></author>
	</entry>
</feed>