Determining the Raspberry Pi type from the commandline

less than 1 minute read

I needed a quick way to determine the model of a Raspberry Pi remotely. There are a few ways to do this, but the easiest I found via Raspbian.

For an easy way to determine the model of your Raspberry Pi from the command line use the following:

dmesg | grep "Machine model:" | cut -d ':' -f 4

If that doesn’t work, for whatever reason, you can always try:

cat /proc/cpuinfo | grep Revision

Then check the revision number against this list