Once you set up a Linux distribution by yourself, you already know which distribution and model it’s.
However for those who use SSH to log in to a distant Linux server offered by an enterprise or shopper, chances are you’ll marvel which Linux distribution and model it’s.
The only method to test Linux model is to see the content material of the /and many others/os-release file:
cat /and many others/os-release
It’s going to present an output much like this:
VERSION=”20.04.1 LTS (Focal Fossa)”
PRETTY_NAME=”Ubuntu 20.04.1 LTS”
As you’ll be able to see, the Linux title is Ubuntu and the model is 20.04.1.
Nonetheless, that is not the one method to know the Linux distribution particulars. On this newbie’s tip, I will present you alternative ways to test which Linux you might be working.
Discover Linux distribution element
Use /and many others/os-release file
In case you are conversant in the Linux listing construction, you most likely already know that /and many others listing comprises the core configuration information of the system.
The os-release file within the /and many others listing retains the details about the Linux distribution. It offers you the distribution title, distribution model, launch title or ID.
You should utilize cat command to view the content material of the file in Linux terminal:
cat /and many others/os-release
Here is what it shows for Alpine Linux server working on Linode infrastructure.
handbook:~# cat /and many others/os-release
PRETTY_NAME=”Alpine Linux v3.12″
As you’ll be able to see, the title of Linux distribution is Alpine Linux and the distribution model is 3.12.
The content material of the /and many others/os-release is often totally different for various distributions. Distributions usually use it to offer extra data like the place to get assist or file bugs and many others.
For instance, the /and many others/os-release supplies extra traces for CentOS Linux.
PRETTY_NAME=”CentOS Linux 8 (Core)”
Nonetheless, all of them present the Linux distribution title and model so it’s a fairly dependable method to know which Linux you might be working. In reality, it’s the most dependable approach.
Use hostnamectl command
Most Linux distributions nowadays use systemd. On such a system, you need to use the hostnamectl command to get Linux model element.
For a similar CentOS system that you simply noticed above, hostnamectl supplies the next particulars:
[[email protected] ~]# hostnamectl
Static hostname: localhost.localdomain
Transient hostname: li2498-99.members.linode.com
Icon title: computer-vm
Machine ID: e3fe2be3e17be3e1763bf43e8337e68b
Boot ID: 33d3052bbffd44b1869bbffd4b00d26c
Working System: CentOS Linux 8 (Core)
CPE OS Identify: cpe:/o:centos:centos:8
Kernel: Linux 4.18.0-147.8.1.el8_1.x86_64
You possibly can see the Linux model element within the line beginning with ‘Working System’.
The hostnamectl command is primarily used for coping with the hostname but when it supplies different particulars why not use it?
Use lsb-release command
That is NOT a command that you’re going to discover in all Linux distributions. I feel it’s largely utilized by Debian/Ubuntu based mostly distributions.
You should utilize the lsb_release command with choice -a and it’ll present distribution particulars:
Do not thoughts the No LSB modules can be found line. It isn’t an error of any type.
[email protected]:~$ lsb_release -a
No LSB modules can be found.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.1 LTS
Bonus Tip: Discover Linux kernel model
Now that you already know which distribution you might be working, maybe you’ll additionally prefer to know in regards to the Linux kernel model working on the system.
You may get the kernel particulars utilizing the uname command in any Linux distribution.
The output reveals solely the Linux kernel model:
handbook:~# uname -r
No prizes for guessing that the above system is working on Linux kernel model 5.4.43.
I hope you discover this fast tip useful to find Linux model element. If in case you have questions or recommendations, please let me know within the remark part.
how to check os version in linux command line,check linux version 32 or 64,current linux version,linux version list,check ubuntu version,red hat linux version command,version of linux operating system,how to check oel version in linux