How to check Linux kernel & OS related information
Sometimes we might require the information about the Linux system we are running, information like Linux/Distro version, its kernel , release name etc. In this tutorial, we will discuss many commands with which we can locate the required information & check Linux kernel, OS & other related information about our Linux systems.
(Recommended Read: Commands to check System & Hardware Information)
(Also Read: Check Linux filesystem for errors: FSCK command with examples )
Check Linux kernel & OS related information
Checking Linux Distro & release version
The best command to check details regarding the Linux distribution, which works on almost all Linux distros is ‘cat /etc/os-release’,
$ cat /etc/os-release
Based on a Linux Distribution, there are some other commands that we can use to check the OS version ,
$ cat /etc/centos-release
$ cat /etc/redhat-release
$ cat /etc/debian-release
$ cat /etc/lsb-release
$ cat /etc/fedora-release
We can also use another command ‘lsb_release’ to get the information about Linux Distro & release version. Run the following command from the terminal,
$ lsb_release –a
But this command is not available by default on RHEL, we need to install package named ‘redhat-lsb-core’ to get this functionality. It’s available by default on Ubuntu 16.04 +.
Checking Kernel version
Similarly like checking Linux Distro & release version, there are various commands that we can use to check the kernel version of the Linux distribution installed. First of such command is ‘uname’, uname command provides us with noth only kernel version but other information like system name, processor architecture, hardware platform , operating system etc.
To get the complete basic information, run
$ uname –a
But if we only need to get the information regarding the kernel , than we can use the option ‘r’ with uname command,
$ uname –r
Another command that will display the kernel information is,
$ cat /proc/version
This command also shows some additional information along with kernel version like name of the user who compiled the kernel, type of kernel, date and time at which the kernel was compiled.
We can also get the list of installed kernel on the system by using the following commands,
$ rpm –q kernelcheck Linux kernel
$ dpkg –list | grep linux-image