There are several ways of knowing the version of Linux you are running on your machine as well as your distribution name and kernel version plus some extra information that you may probably want to have in mind or at your fingertips.
Therefore, in this simple yet important guide for new Linux users, I will show you how to do just that. Doing this may seem to be a relatively easy task, however, having a good knowledge of your system is always a recommended practice for a good number of reasons including installing and running the appropriate packages for your Linux version, for easy reporting of bugs coupled with many more.
Find Out Linux Kernel Version
We will use uname command, which is used to print your Linux system information such as kernel version and release name, network hostname, machine hardware name, processor architecture, hardware platform and the operating system.
To find out which version of Linux kernel you are running, type:
$ uname -or
In the preceding command, the option -o prints operating system name and -r prints the kernel release version.
You can also use -a option with uname command to print all system information as shown:
$ uname -a
Next, we will use /proc file system, that stores information about processes and other system information, it’s mapped to /proc and mounted at boot time.
Simply type the command below to display some of your system information including the Linux kernel version:
$ cat /proc/version
From the image above, you have the following information:
- Version of the Linux (kernel) you are running: Linux version 4.5.5-300.fc24.x86_64
- Name of the user who compiled your kernel: firstname.lastname@example.org
- Version of the GCC compiler used for building the kernel: gcc version 6.1.1 20160510
- Type of the kernel: #1 SMP (Symmetric MultiProcessing kernel) it supports systems with multiple CPUs or multiple CPU cores.
- Date and time when the kernel was built: Thu May 19 13:05:32 UTC 2016
Find Out Linux Distribution Name and Release Version
The best way to determine a Linux distribution name and release version information is using cat /etc/os-release command, which works on almost all Linux system.
---------- On Red Hat Linux ---------- $ cat /etc/redhat-release ---------- On CentOS Linux ---------- $ cat /etc/centos-release ---------- On Fedora Linux ---------- $ cat /etc/fedora-release ---------- On Debian Linux ---------- $ cat /etc/debian_version ---------- On Ubuntu and Linux Mint ---------- $ cat /etc/lsb-release ---------- On Gentoo Linux ---------- $ cat /etc/gentoo-release ---------- On SuSE Linux ---------- $ cat /etc/SuSE-release