Because I own a number of Raspberry Pi systems, I get roughly the same question quite regularly about each one of them: how can I confirm what this Raspberry Pi model is from the command line? The reason I usually want to know is because the model of the Raspberry Pi hints the Raspbian release that will support it (older Raspbian releases do not have support for the most recent models of Raspberry Pi).
There’s a few hardware specs like CPU speed and generation, and also a memory size – they used to be helpful in getting the question above answered.
But turns out there’s an even better way: use the model file in the /proc/device-tree directory, like shown below:
On another server it returns this:
Once you confirm the hardware model, consult the Raspbian OS - Hardware Support page to see Raspbian versions supporting it.