Users often seem confused about what Pi model they have and what OS version is installed or how to find details.

Where is this located?


To list the initial installation (Raspbian only) cat /etc/rpi-issue | grep reference

Raspberry Pi reference 2019-06-20

To list the Current OS lsb_release -irdc

Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 10 (buster)
Release:    10
Codename:   buster

To list the Kernel version uname -r


To list the Model cat /proc/device-tree/model

Raspberry Pi 4 Model B Rev 1.1

There are a number of other interesting data:-

To list the hostname hostname


To list the Firmware /opt/vc/bin/vcgencmd version

Jul  9 2019 14:37:58 
Copyright (c) 2012 Broadcom
version d2b1b7fb01475cb3914b2086299e32d724e832f1 (clean) (release) (start)

To list the date the File System was "created" sudo tune2fs -l /dev/mmcblk0p2 | grep created (only for Raspbian on SD Card, but could be modified for other)

Filesystem created:       Fri Jun 21 03:05:22 2019

The following script is one I use including the above commands to collect relevant details. (It is called about)

#! /bin/sh
if [ -e /etc/rpi-issue ]; then
 echo "- Original Installation"
 cat /etc/rpi-issue
if [ -e /usr/bin/lsb_release ]; then
 echo "- Current OS"
 lsb_release -irdc
echo "- Kernel"
uname -r
echo "- Model"
cat /proc/device-tree/model && echo
echo "- hostname"
echo "- Firmware"
/opt/vc/bin/vcgencmd version
sudo tune2fs -l /dev/mmcblk0p2 | grep created

The output on my Pi3A+ shows

- Original Installation
Raspberry Pi reference 2018-11-13
Generated using pi-gen, https://github.com/RPi-Distro/pi-gen, 7e0c786c641ba15990b5662f092c106beed40c9f, stage4
- Current OS
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.6 (stretch)
Release:    9.6
Codename:   stretch
- Kernel
- Model
Raspberry Pi 3 Model A Plus Rev 1.0
- hostname
- Firmware
Nov  4 2018 16:31:07 
Copyright (c) 2012 Broadcom
version ed5baf9520a3c4ca82ba38594b898f0c0446da66 (clean) (release)
Filesystem created:       Tue Jan  1 12:09:51 2019

It should produce a meaningful output on most Linux distributions, e.g. Ubuntu MATE

- Current OS
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.5 LTS
Release:    16.04
Codename:   xenial
- Kernel
- Model
Raspberry Pi 2 Model B Rev 1.1
- hostname
- Firmware
Dec  9 2016 15:11:26 
Copyright (c) 2012 Broadcom
version 2e557d8dac70add28597c3b449cb52c34588d818 (clean) (release)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.