Identify Raspberry Pi hardware from Terminal

Especially for remote Raspberry Pis or those embedded inside a housing, it is useful to identify the hardware identity from the Terminal:

cat /sys/firmware/devicetree/base/model

Raspberry Pi 3 Model B Rev 1.2

cat /proc/cpuinfo | grep Model

Model : Raspberry Pi 3 Model B Rev 1.2

To further distill which hardware revision (like 3B vs. 3B+), manufacturer, RAM, etc. use this table from Raspberry Pi documentation to decode.

cat /proc/cpuinfo | grep Revision