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?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
To list the initial installation (Raspbian only)
cat /etc/rpi-issue | grep reference
Raspberry Pi reference 2019-06-20
To list the Current OS
Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster
To list the Kernel version
To list the Model
Raspberry Pi 4 Model B Rev 1.1
There are a number of other interesting data:-
To list the hostname
To list the Firmware
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 fi if [ -e /usr/bin/lsb_release ]; then echo "- Current OS" lsb_release -irdc fi echo "- Kernel" uname -r echo "- Model" cat /proc/device-tree/model && echo echo "- hostname" 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 4.14.79-v7+ - Model Raspberry Pi 3 Model A Plus Rev 1.0 - hostname MilliwaysPi3A - 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 4.4.38-v7+ - Model Raspberry Pi 2 Model B Rev 1.1 - hostname PiUbuntu - Firmware Dec 9 2016 15:11:26 Copyright (c) 2012 Broadcom version 2e557d8dac70add28597c3b449cb52c34588d818 (clean) (release)