Linux version release command

4 Useful Commands to Check Linux Version

How to check Linux version is a commonly asked question during a Linux job interview. The OS version of a Linux distribution can be determined by using the command-line interface as well as a graphical user interface.

In Linux, CLI is preferred over GUI as it provides more control over the OS. In this article, we will mostly focus on the command line methods which can be used to check the OS version of a Linux distribution.

What is the difference between Linux and other operating systems?

Linux is an open source operating system that was created in 1991 by Linus Torvalds. It is different from other operating systems because it is based on the Linux kernel. Linux is also free and can be used on a variety of devices.

What is the best Linux distribution?

The most popular and widely used distributions are Ubuntu, Debian, Red Hat Enterprise Linux (RHEL), CentOS, Fedora. Other distros include Arch Linux, Gentoo Linux and openSUSE.

What are the benefits of using Linux?

Some of the benefits of using Linux include its stability, security, flexibility and cost. Linux is also a more secure operating system than Windows. It can be used on a variety of devices, including desktops, laptops, servers and smartphones.

Check Linux version from /etc/os-release

The best way to check Linux version is using cat /etc/os-release command. This command will list Linux distribution name and release version information. It works on almost all Linux system.

If we are running a very old Linux distribution then we might not be able to use any of the above commands. Use the following command to know the OS version on our old 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
Читайте также:  Операционная система windows linux solaris

Check Linux version with uname command

We can also use uname command to check Linux version. It is used to print our Linux system information such as kernel version and release name, network hostname, machine hardware name, processor architecture, hardware platform and the operating system.

The command uname -a shows the version of the Linux kernel we are using, as well as additional details.

Linux deb-srv 5.10.0-8-amd64 #1 SMP Debian 5.10.46-4 (2021-08-03) x86_64 GNU/Linux

Check Linux version from /proc/version

As we can see, the /proc/version file specifies the version of the Linux kernel, the version of gcc used to compile the kernel, and the time of kernel compilation. It also contains the kernel compiler’s user name.

Check Linux version with lsb_release command

The lsb_release command is a helpful utility to find out information about our Linux installation. It displays LSB (Linux Standard Base) information about the Linux distribution.

lsb_release -a
Output
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

To display only the description, run:

Ubuntu, Debian, Fedora, openSUSE, and Mint are all popular Linux distros.

What is the difference between Linux distributions?

There are many different types of Linux distributions, also called distros. Each one has its own features, but the core components are the same.

Why are there so many Linux distributions?

There are many reasons why there are so many Linux distributions. One reason is that Linux is open source, which means that anyone can create a new distribution. Linux is also very customizable, which means that people can create distributions that fit their needs or preferences. Additionally, different Linux distributions can appeal to different types of users. For example, some distributions are more geared towards beginners, while others are more geared towards experts.

How do I change my Linux distribution?

You can always switch to another distro if you find that it works better on your system or meets more of your needs. You will want to make sure that your system meets the requirements of the new distro, and you may need to reinstall some applications.

David is a Cloud & DevOps Enthusiast. He has years of experience as a Linux engineer. He had working experience in AMD, EMC. He likes Linux, Python, bash, and more. He is a technical blogger and a Software Engineer. He enjoys sharing his learning and contributing to open-source.

howtouselinux.com is dedicated to providing comprehensive information on using Linux.

We hope you find our site helpful and informative.

Источник

How to Check the Linux OS Version (6 Ways)

Check Linux version

Linux OSes are some of the best replacements for Windows and macOS because they have gotten impressively capable over the years. Not just the Linux kernel but a lot of components like desktop environments and display servers are now more capable than they were before. With too many distro releases, keeping track of Linux versions could be challenging, especially on rolling releases. So, here are six ways to check the Linux OS version easily on your PC.

Читайте также:  Проверка работы kerberos linux

1. Check Linux Version using lsb_release Command

“LSB” stands for Linux Standard Base and the lsb_release command was specially developed to allow Linux users to check their Linux OS version; that’s all it does. To check the Linux OS version, paste the below command in the terminal and hit enter.

lsb release command Linux

The -a stands for “all” in the command, meaning you are asking the “lsb_release” command to list all the details about your Linux distro. You could also use -d, -r, and -c to find out the description, release, and codename using this command, respectively.

2. Check Linux OS Version using Neofetch

Unlike other commands that only display text, Neofetch is a fancy command that displays the ASCII art of the logo of the distro you are using. In addition to the artwork, it shows everything you would need to know about the distro, including the Linux version, resolution, desktop environment, processor, GPU, and memory. Now, the Neofetch command doesn’t come installed by default, so you will first need to install it.

# For Ubuntu/Debian-based distros sudo apt install neofetch # For Fedora/CentOS sudo dnf install neofetch # For Arch-based distros sudo pacman -S neofetch # For OpenSUSE sudo zypper install neofetch

Once installed, type neofetch in the Linux command line and hit Enter. Here’s what you will see as the output:

neofetch

3. Check Linux Version using Cat Command

The cat command in Linux stands for “concatenate,” and this highly useful Linux command is specifically used to display file contents in the terminal. To get the details about the Linux OS version using the cat command, we need to target the “os-release” text file that resides in the /etc directory inside the root. Here’s how:

Cat command os-release linux

4. Check Linux Version using Uname Command

Most of the aforementioned commands do not display the kernel version. However, if you specifically want to check the kernel version of your Linux OS, uname is the only command you need.

“uname” is short for Unix Name and is specifically meant to display details about Linux desktops. It comes built into Linux, and here is how you use the command:

uname command - check os version in Linux

5. Check Linux Version using Hostnamectl Command

Last but not least command, you can also use the “Hostnamectl” command to find out the Linux OS version. As the name suggests, this command is used to display the hostname of the distro. This command will only work with sudo privileges:

hostnamectl linux

6. GUI Method to Check the Linux OS Version

If you are new to Linux, you probably don’t like the terminal much because it hasn’t grown on you yet. Hence, if you don’t like using the terminal and are looking for a way to find out the Linux version, it’s possible with this GUI method.

Читайте также:  Can find library linux

1. Go to Settings on your Linux PC.

2. Scroll all the way down and open the “About” section.

3. Here, you should see the details about the installed Linux distro.

Pop!OS about section - check os version linux

Bear in mind that the Settings app on your distro may look vastly different from ours. If you don’t see the “About” section right away, it’s usually located in the settings and you may need to dig a bit deeper.

Frequently Asked Questions

There are different commands like lsb_release, uname, Hostnamectl, cat, and neofetch that you can use to check the current version on Linux OS.

To check the Linux version on Ubuntu, go to the command terminal and execute the “lsb_release” command.

Источник

How do I find out what version of Linux I’m running?

Is there a way to determine what version (distribution & kernel version, I suppose) of Linux is running (from the command-line), that works on any Linux system?

I’d just like to point out for the record how stupid it is that this is a question which needs asking. This is really quite an indictment on the state of every linux distro.

9 Answers 9

The kernel is universally detected with uname :

$ uname -or 2.6.18-128.el5 GNU/Linux 

There really isn’t a cross-distribution way to determine what distribution and version you’re on. There have been attempts to make this consistent, but ultimately it varies, unfortunately. LSB tools provide this information, but ironically aren’t installed by default everywhere. Example on an Ubuntu 9.04 system with the lsb-release package installed:

$ lsb_release -irc Distributor ID: Ubuntu Release: 9.04 Codename: jaunty 

Otherwise, the closest widely-available method is checking /etc/something-release files. These exist on most of the common platforms, and on their derivatives (i.e., Red Hat and CentOS).

$ cat /etc/lsb-release DISTRIB_ID=Ubuntu DISTRIB_RELEASE=9.04 DISTRIB_CODENAME=jaunty DISTRIB_DESCRIPTION="Ubuntu 9.04" 

But Debian has /etc/debian_version :

$ cat /etc/debian_version 5.0.2 

Fedora, Red Hat and CentOS have:

Fedora: $ cat /etc/fedora-release Fedora release 10 (Cambridge) Red Hat/older CentOS: $ cat /etc/redhat-release CentOS release 5.3 (Final) newer CentOS: $ cat /etc/centos-release CentOS Linux release 7.1.1503 (Core) 
$ cat /etc/gentoo-release Gentoo Base System release 1.12.11.1 

I don’t have a SUSE system available at the moment, but I believe it is /etc/SuSE-release .

Slackware has /etc/slackware-release and/or /etc/slackware-version .

Mandriva has /etc/mandriva-release .

For most of the popular distributions then,

will most often work. Stripped down and barebones «server» installations might not have the ‘release’ package for the distribution installed.

Additionally, two 3rd party programs you can use to automatically get this information are Ohai and Facter.

Note that many distributions have this kind of information in /etc/issue or /etc/motd , but some security policies and best practices indicate that these files should contain access notification banners.

Источник

Оцените статью
Adblock
detector