Skip to content

Instantly share code, notes, and snippets.

@cellularmitosis

cellularmitosis/README.md

Last active May 31, 2020
Embed
What would you like to do?
Identify Raspberry Pi model from the command line

Blog 2020/5/2

<- previous | index | next ->

Identify Raspberry Pi model from the command line

Thanks to the API at perturb.org, this is a one-liner:

$ curl -L perturb.org/rpi?rev=$(awk '/^Revision/ { print $3 }' /proc/cpuinfo)
Revision : a02082
Model    : 3 Model B
Memory   : 1 GB
Overvolt : No
Released : Q1 2016
Notes    : (Mfg by Sony)

See also https://elinux.org/RPi_HardwareHistory

Turn this into a handy script, as /usr/local/bin/pi:

#!/bin/bash
set -e -o pipefail
curl -L perturb.org/rpi?rev=$(awk '/^Revision/ { print $3 }' /proc/cpuinfo)
#!/bin/bash
set -e -o pipefail
curl -L perturb.org/rpi?rev=$(awk '/^Revision/ { print $3 }' /proc/cpuinfo)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.