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

check Linux kernel

 

Based on a Linux Distribution, there are some other commands that we can use to check the OS version ,

For CentOS

$ cat /etc/centos-release

For Redhat

$ cat /etc/redhat-release

For Debian

$ cat /etc/debian-release

For Ubuntu

$ cat /etc/lsb-release

For Fedora

$ 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,

For RHEL/CentOS/Fedora

$ rpm –q kernelcheck Linux kernel 

For Ubuntu/Debian

$ dpkg --list | grep linux-image

This completes our tutorial on how to check Linux kernel, OS & related information on various Linux distributions. Please feel free to send any questions you have using the comment box below.

 

If you think we have helped you or just want to support us, please consider these :-

Connect to us: Facebook | Twitter | Google Plus

Donate us some of your hard earned money: [paypal-donation]

Linux TechLab is thankful for your continued support.