Skip to content

How-to / Raspberry Pi

Check your Raspberry Pi model from the command line

Find out which Raspberry Pi model you have using terminal commands. Check your board's model number, revision code, memory, and other hardware details without opening a GUI.

BeginnerSystem info · TerminalBy Vilros

Quick method

The fastest way to identify your Raspberry Pi model is using the pinout command, which displays your board information along with a GPIO diagram:

  1. Open Terminal on your Raspberry Pi.
  2. Type the following command and press Enter:
    pinout
  3. The output will show your Pi model, revision, memory, and a GPIO pinout diagram.

The pinout command is part of the GPIO Zero library, which is pre-installed on Raspberry Pi OS. It provides a friendly summary of your board in one command.

Detailed information

For more detailed hardware information, you can read directly from the system's device tree:

cat /proc/device-tree/model

This command prints the exact model string, such as Raspberry Pi 4 Model B Rev 1.5. The output comes directly from the firmware and is the most authoritative source for your board's identity.

To see your Pi's revision code, which encodes manufacturing details:

cat /proc/cpuinfo | grep Revision

The revision code is a hexadecimal value that indicates the board type, memory size, manufacturer, and revision. You can decode it using the official Raspberry Pi revision code list.

Check memory

To check how much RAM your Raspberry Pi has, use the free command:

free -h

The -h flag displays memory in human-readable format (MB or GB). Look at the "total" column under "Mem:" to see your Pi's total memory.

For example, a Raspberry Pi 4 with 4GB of RAM will show approximately 3.7–3.9GB total due to memory reserved for the GPU and system overhead.

Original Vilros method

The original Vilros guide suggested using just free without the -h flag. That works too and shows memory in kilobytes, but free -h is easier to read for most users.

Other useful commands

Here are additional commands to gather hardware and system information:

  • OS version:
    cat /etc/os-release
    Shows Raspberry Pi OS version and codename.
  • CPU information:
    lscpu
    Displays CPU architecture, cores, and specifications.
  • Kernel version:
    uname -a
    Shows the Linux kernel version and build details.
  • Hardware summary:
    cat /proc/cpuinfo
    Lists detailed CPU and board information, including the revision code and serial number.

If it doesn't work

  • pinout command not found: Update your Raspberry Pi OS to ensure you have the latest GPIO Zero library: sudo apt update && sudo apt install python3-gpiozero.
  • Permission denied: The commands listed here don't require sudo. If you see permission errors, check that you're logged in as the default pi user or another user with normal access.
  • Confusing output: If cat /proc/device-tree/model doesn't show anything, try cat /proc/cpuinfo and look for "Model" or "Revision" lines.

Need help identifying your Pi?

Tell us what output you see from the pinout or free commands, and we can help you identify your board.

Contact Vilros Support ↗