Read Linux distribution and release
You can use “/ etc / os-release” to retrieve information about the installed Linux distribution and the release
cat /etc/os-release
This is what I saw
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
You can also use cat /etc/issue to retrieve the name and version number
cat /etc/issue
This is what I saw
Raspbian GNU/Linux 10 \n \l
Read Linux kernel version
uname -a
This is what I saw
Linux raspberrypi 5.4.79-v7l+ #1373 SMP Mon Nov 23 13:27:40 GMT 2020 armv7l GNU/Linux
You can see the version number of the Linux kernel that comes in the third position – 5.4.79-v7l+.
The processor architecture on which Raspberry Pi runs. Recognizable in the output from my Raspberry Pi 4 as “armv71”, other Raspberry Pi hardware may return a different architecture.
If you only want the kernel version
uname -r
This is what I saw
5.4.79-v7l+
You can also use the following
ucat /proc/version
This is what I saw
Linux version 5.4.79-v7l+ (dom@buildbot) (gcc version 8.4.0 (Ubuntu/Linaro 8.4.0-3ubuntu1)) #1373 SMP Mon Nov 23 13:27:40 GMT 2020