If you’re an avid Linux enthusiast who knows their way around the OS, you might already be having a few tricks up your sleeve and know your Linux inside-out. However, if you’re just starting out, you should definitely read this article to learn how to check Linux version you’re running.
It will definitely help you to learn new things and tricks about your system and check the compatibility before downloading any new software. Further, this will help report any bugs more easily. That being said, the inspiration for this simple guide is to get you well acquainted with your OS and Linux version.
Now, let’s get started…
How to Check Linux Version: Linux Kernel
If by Linux version, you simply want to know the Linux Kernel version, there is just one command you need to know about. The uname command is a universal command that displays the Linux Kernel version and other system information on the terminal.
Let me show you how.
To find the Linux version of Kernel only, type below command:
$ uname -or
Here uname will print the Linux system info and the option -o is used to display OS name whereas -r is used to display the release version of the Linux Kernel.
For more information about your Linux system, type in the command:
$ uname -a
This command will list all the information about your Linux version and system altogether on the terminal screen which includes:
- Kernel Version
- Release name
- Network hostname
- Processor Architecture
- Hardware platform
- Machine Hardware name
- Operating System Name
Wasn’t it easy? Just one simple command and you’ll know just everything. However, what if you want to check Linux version of the distribution. There is just no dedicated command in Linux for that purpose. But I have your back.
So, let’s move to our next section now.
How to Check Linux Version: Linux Distribution Name and Release Version
As noted above, there is no particular command to check the Linux distribution and release version on your system. Nonetheless, there are a few commands and methods to find out.
Using LSB Tools
The following command can help you check Linux version and release of the distro running your system.
$ lsb_release -a
This command will work easily on Ubuntu. However, it can cause a problem with other Linux distros. If it works well for you, the following information will be displayed:
Distributor ID, Description, Release Version and the code name for the version.
If you’re using any other Linux distro don’t worry, you can check Linux version and release the name of your distribution using the etc command and the OS name after that.
Let me show you how…
$ cat /etc/debian_version
For Red Hat Versions
$ cat /etc/redhat-release
For Fedora Versions
$ cat /etc/fedora-release
$ cat /etc/centos-release
$ cat /etc/SUSE-release
$ cat /etc/slackware-release
If you’re using any other Linux distro, don’t worry. Just type in the command cat/etc/ followed by the OS name-release and you’ll be able to figure out the name of the Linux distro. For checking the version, replace release with the version in the commands and your answer will be displayed on the terminal.
Now, that was all from my end. I hope you liked this post and would try it on your Linux distro. Remember, Linux is a beautiful and powerful open-source OS that puts all the power in the user’s hands provided you know how to make use of it.
This small guide will help you enjoy the immense benefits of Linux and hold the reigns of your OS even tighter now that you’re aware of the Linux kernel and distribution version on your system.
If you think I’ve missed something important, let me know by dropping in a quick comment below and help the fellow users as well.
‘Til next time. Stay updated.