Linux how to know os version

Linux how to know os version

How to check the OS and Linux Version

Are you looking for ways to find the OS details of your system? Here are the command-line ways of checking the OS and Linux version from the Terminal.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

I t is essential to know the currently installed operating system, its version, and also the Linux kernel version on your machine to install the correct packages and apply the appropriate security patches. Not just that, being a system administrator, knowing the system details also comes in handy for troubleshooting issues.

In this guide, we are going to walk you through various methods to determine your Linux version.

Checking the OS and Linux version

We have two main ways:

Let’s get started.

Method 1: Graphical User Interface Way

Typically, using a graphical user interface to perform any task is considered the most comfortable way, but you get limited information. Most of the Linux distros have an About or System Information app that should give you necessary OS details. In the below example, we fetch details from the Ubuntu system.

Step 1. From Ubuntu’s top panel, click on the Dropdown arrow.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionOpen DropDown Arrow

Step 2. Click the Settings button to open the settings application.

Step 3. From the left panel, scroll down and open the Details menu.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionOpen Details Menu

Step 4. From the left panel, select the About option.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionChoose the About Option

Step 5. You should now see the details of your system. As you see in the below screenshot, I could see RAM size, Processor type, Graphics info, Desktop Environment version (GNOME in my case), OS architecture, and disk size.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionAbout

Method 2: Command Line Way

This method is the most favorite method among Linux users because sometimes you may be working on a machine that has no graphical user interface installed, such as Ubuntu Server. Note that several commands can be used. We discuss the best commands to use.

lsb command

Launch the Terminal. On Ubuntu machines, this can be done by pressing Ctrl+Alt+T simultaneously. Enter the following command in the Terminal and press enter.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionUsing lsb command

hostnamectl Command

Another command you can use to preview some information about your system is the command used to get the machine hostname.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionUsing hostnamectl Command

As you can notice, the hostnamectl command will preview some additional information about your system, including the Linux distro version and Linux Kernel version too.

/etc/issue File

Another way is to open a file in the path /etc/issue file that holes the OS information:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionUsing issue File

/etc/os-release File

There is yet another file in the path /etc/os-release that holds some info about the currently installed operating system.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionUsing hostnamectl Command

/etc/os-release File

Finally, you can also use the lsb-release File to view the current system version.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os versionlsb-release File

Conclusion

Those are all the ways you can use to fetch the OS version and Linux version details from your system. I hope the tutorial helped you in learning one or two things about the Linux command-line usage. Feel free to pick the one you feel comfortable with. That’s it for now.

how to find the os version in linux from command line

Linux and Unix operating systems comes in a wide range of flavors often bundled as different distributions by different vendors. Every one of these distributions also comes with an often particular version of the Linux kernel. Mostly it is a latest version of the kernel, but you would want to check the kernel version to see how up to date it is.

When you need to know the exact name and version of your operating system, as well as the kernel, there are several different ways to do it. There are some common reasons why you might want to check your OS version, it might be it to install the correct version of a software, find if a hardware is compatible or be it to upgrade your OS itself.

As I mentioned, there are several ways to find your operating system and Linux kernel versions. As each distribution (or distros) is slightly different some of these commands might work only in certain distros.

uname

uname is the Linux command which prints out the name, OS versions and other details of the machine and kernel running on the machine. It is basically short for Unix Name. This is usually part of the core-utils package and should be available on almost all distros. There are several options available to print out just the kernel details or just the machine information.

To print out just the kernel information, use the -srv option. It prints out all the available kernel information.

The first part prints out the kernel name, which is Linux in the above example. The second part is the kernel release version, which is 3.3.0-gentoo. The rest of it is a more detailed kernel information like the compilation date and config.

To print out the machine information, use the -mnipo options.

machinename is the name of the machine, while the rest is the processor architecture, processor type, version, speed and operating system information.

You can also use the -a option which prints out all the available information about the kernel and the machine.

hostnamectl

Another command to check the os version is the hostnamectl command. This is a handy command that can be used to query and modify the system hostname and other related settings.

Static hostname: borgen
Icon name: computer-desktop
Chassis: desktop
Machine ID: 3467dffddf9247cda64a3f684571c7c4
Boot ID: 55e62de550c9400384776c8501d41f07
Operating System: Sabayon/Linux
Kernel: Linux 4.18.0-sabayon
Architecture: x86-64

As you can see, the hostnamectl command will pretty print the os version and other related information. You can find the operating system, the architecture and kernel versions quite easily.

/etc/release and OS version files

Some distributions ships with a separate set of files which specify the release and versions of the distro. These files are usually in the /etc folder with either the word release or version in them. You can view these files using any text editor or the cat command.

bash$ cat /etc/*-release*
Output:
Gentoo Base System release 2.1
DISTRIB_ID=»Gentoo»

bash$ cat /etc/*-version*

bash$ cat /etc/issue

These files should exist in most distributions. They are created or installed from the installer package when you first install the system. However, if you have previously updated the kernel manually since installing the operating system then the information in these files might be wrong.

lsb_release

lsb_release (Linux Standard Base Release) is another command which prints out useful information about the distribution. The command has several options to print out specific information, but the -a or the –all option prints out all the information.

/proc/version

Another option you have is to check the proc version. You can do so by using the cat command to print out the contents of the /proc/version file.

bash$ cat /proc/version
Output:
Linux version 3.3.0-gentoo ([email protected]name) (gcc version 4.5.3 (Gentoo 4.5.3-r2 p1.1, pie-0.4.7) ) #2 SMP PREEMPT Wed Mar 21 02:07:10 CDT 2012

This prints out a complete and detailed list of information about your kernel, processor, machine and operating system.

I usually rely on either the uname or the /proc/version file to get the reliable version information for the OS as well as the kernel. You can use the other methods if either of these two options does not work.

How to Check OS Version from Command Line

Knowing the name and version of a distro is vital for users and administrators. The information is important in numerous situations like installing new apps or features, troubleshooting, etc. This guide will demonstrate how to check the OS version from the command line on Linux.

Checking the operating system version

Here are some of the simplest ways of checking the operating system version. Almost all of these methods should apply to any Linux distro. These methods utilize the built-in tools and feature Linux comes with.

Checking OS version from /etc/os-release
In Linux, the os-release file contains various information about the system. There are two copies of the file at two different locations.

Interestingly, the file located at /etc/os-release will take precedence over /usr/lib/os-release.

It contains information in the format of a newline-separated list of various variables. It contains info like OS name, version, version ID, builds ID, etc.

To check the content of the os-release file, run the following command.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Note that the output will vary from one Linux distro to another. This file will only be available if the OS uses the systemd as the init system.

Here are some examples that fine-tune the content of os-release to print only specific details. The following command will print only the version and name of the OS.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

To check the version of the OS only, run the following command instead.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Checking OS version using lsb_release
The lsb_release tool provides certain LSB (Linux Standard Base) and distro-specific info. Generally, lsb_release is used in the following format.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Here, the flag “-a” tells lsb_release to print all the info about the OS it can provide. Alternatively, you can print a minimal report using the flag “-s” or “–short”. It will omit the headers in the output.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

This tool also supports printing one specific piece of information at a time. For example, to print only the OS description, use the flag “-d” or “–description”.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

To display the codename of the current OS, use the flag “-c” or “–codename”.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

The man page contains an in-depth description of all the available options.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Checking OS version using hostnamectl
The hostnamectl command is responsible for managing the Linux system hostname and related settings. It can also print a host of info on the system and operating system.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Checking OS version using uname
Similar to lsb_release and hostnamectl, uname is another tool to report various info about the machine and operating system. However, the output is a bit more disorganized compared to hostnamectl output.

To print all the information about the system, run the following uname command. Here, the flag “-a” tells uname to print all the supported info.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

We can also tell uname to print only specific detail. For example, the flag “-v” or “–kernel-version” will print the kernel version.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

The following uname command will print the operating system label.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

For all the available options and their explanations, check the man page.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Checking OS version from /etc/issue
The file /etc/issue stores system identification information. It’s generally shown before you’re prompted to log in to your account. Check the content of the file.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Checking OS version using /proc/version
It’s a text file that includes information about the Linux kernel.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Checking OS version using /etc/*release
If none of the aforementioned methods succeeded, then it’s highly likely that you’re running a very old Linux system. If that’s the case, then we have to take advantage of a very rudimentary method of checking OS information.

Run the following command.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Here, cat will read and print the content of all the files that match the pattern. You can check what files we’re reading from.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Final thoughts

This guide demonstrates how to check the version of the Linux operating system running on the machine. Although there are many third-party tools, we can achieve it using the built-in tools and features only.

The version of a Linux operating system is an important piece of information. Generally, Linux packages are built to work with a particular Linux version in mind. Knowing the Linux version can help in troubleshooting unexpected behaviors or errors. It’s also important when a new version of the Linux distro is released. It’s simple yet crucial info to keep track of.

About the author

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Sidratul Muntaha

Student of CSE. I love Linux and playing with tech and gadgets. I use both Ubuntu and Linux Mint.

How to Check the OS version in Linux

There are number of ways through which you can check the version of OS in a Linux system. In this article, we will explain both graphical and the command-line ways to obtain the OS version of a Linux system.

We have used Debian 10 OS for explaining the commands and methods mentioned in this article.

Check OS Version via Graphical User Interface

To check the OS version via the graphical user interface, follow the below steps:

Step 1: First, you will need to open the Settings utility in your system. To do so, right-click n your desktop and click Settings as shown in the following screenshot:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Alternatively, you can also search for the Settings utility from the Applications menu. Hit the super key on your keyboard and in the search bar type settings. When the Settings icon appears, click on it to open.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Step 2: In the Settings utility, go to the Details tab as shown in the following screenshot.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Step 3: When you click the Details tab, the following window will appear by default in About view. Here you will find the version of your OS which in our case is Debian 10. Apart from the version information, you will find some other information as well such as memory, processor, graphics, OS type, and disk size etc.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Check OS Version via Command-line Terminal

Following are some command-line ways through which you can view the OS version in your system.

Open the command line Terminal by hitting the super key on your keyboard and searching for the Terminal application by typing its keyword in the search bar. When the Terminal icon appears, click on it to open.

Using the lsb_release command

The lsb_release command allows you to find LSB (Linux Standard Base) information about your Linux distribution that includes release number, codename, and the distributor ID.

In some Linux distributions because of minimal installation of OS or some other reason, the lsb_release command might be missing from your system. In that case, if you run lsb_release command, you may receive the error “No LSB modules are available”.

To solve this issue, you have to first install lsb_release using the apt-get command as follows:

Once installed, you can then run the following lsb_release command in order to view the version of your OS along with other information:

From the below output, you can see the LSB information specific to our distribution that includes the release number or the version number of our OS that is Debian 10.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

If you just want to print out the version information instead of whole LSB information, use lsb_release with the –d switch as follows:

will just print the description line showing the version number.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Using /etc/issue file

In /etc/issue file, system identification text is stored which is displayed before the login prompts. This file normally contains info about the Linux version which you can view using the cat command as follows:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

The above command only displays the version number of your OS. However, if you need to know the OS version with the point releases, enter the following command:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Using /etc/os-release file

The /etc/ost-release file is a configuration file that is the part of the systemd package which contains OS identification data. You will find this command only in the latest Linux distribution. Using the /etc/os-release command, you can obtain the version information of your OS.

To display the contents of the os-release file, run the following command in Terminal:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Using hostnamectl command

The hostnamectl command is also a part of the systemd package. Generally, it is used to check and modify the hostname. However, you can also use it to check the version of your OS. Similar to the above command, hostnamectl command also works on the latest Linux distributions.

To use this command for viewing the OS version, run the following command in Terminal:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Check Kernel version

If you want to find out the kernel version of your system along with the OS version, following are some command-line ways to do so:

Using uname command

The uname command is used to display basic system information. To find the kernel version, you can use uname with –r option as follows:

You will receive the output similar to this:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

From the above output, you can see the Linux kernel that we are running is 4.19.0-5-amd64 where:

Using dmesg command

The dmesg command is generally used to examine kernel boot messages and to debug hardware-related problems. However, we can also use it to check the version of the kernel. Pipe the dmesg with the grep command as follows to view the kernel information:

You will find the kernel version in the first line of the output.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Using /proc/version

The /proc/version file also contains the Linux kernel information. To view this file, use the following command in Terminal:

You will see the output similar to the below screenshot displaying the kernel version in the first line.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Note: You can check Out Debian Latest versions including the old releases at the following official page:

In this article, we have covered some ways including both the graphical and the command line through which you can view the version of OS as well as the version of kernel you are running on your system.

About the author

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Karim Buzdar

Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.

How to Check Linux OS Version

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Linux is a free and open-source operating system and it has various distributions such as Ubuntu, Red Hat, Debian, Fedora, CentOS, OpenSUSE, and Arch. Every Linux operating system has a Linux Kernel, software collections, and GNU tools and libraries. Determining the Linux distribution, Kernel version, and Linux version is very important to figure out which package manager to use for installing new packages.

Linux operating system version is the very first thing we need to know before installing software, applying security updates, applying bug fixes, or deciding which development framework to use. When you install bug fixes or security updates, your OS version changes.

In this tutorial, we learn how to check the Linux OS Version.

Table of Contents

Differences between OS and Kernel Version?

Linux OS is a system software that provides an interface between the computer and the user. When your computer boots, the OS is the first software that loads. However, Kernel is the base of the Linux operating system that converts commands to machine language.

The Linux OS version is not always the same as the Kernel version. OS release means the stable version of the Linux distribution, but the Linux Kernel version is the build number of the source Kernel that is used as a base of the operating system. A version of every package is associated with the Kernel version.

Commands to Check Linux Version

The following table lists some of the most common ways to identify Linux OS version:

How to Check Linux OS Version

There are a variety of ways to check the Linux OS versions, based on your Linux distribution. For example, the lsb_release packages are not installed on Red Hat Linux distractions by default, and the hostnamectl command works only on the systemd based distributions.

The following command examples show you how to check the OS version on your Linux system:

The /etc/os-release File

The /etc/os-release file contains Linux OS identification information, which includes Linux distribution name and distribution version.

Run the following cat command on the /etc/os-release file to check the configuration of your Linux system:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

You can also type the following command to filter out OS Version information:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

The lsb_release Command

Use the lsb_release command line utility to display Linux Standard Base (LSB) information about the Linux distribution installed on your system. It shows details such as release codename, Linux version number, and distributor ID.

The lsb_release command is part of the software package known as the LSB core, and it is not installed by default on various Linux distributions, such as Red Hat and CentOS.

For example, the following command displays all release related information about your Linux distribution:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

The Inxi Tool

The Inxi is a powerful command line script that provides system information. This command line utility can be used to display hardware configuration, system configuration, GCC version, Linux Kernel version number, and a variety of other useful information.

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

The hostnamectl Command

When used without any options, hostnamectl can be used to display static hostname, machine ID, boot ID, virtualization, OS name and version, and Kernel release. For example:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

You may also use the hostnamectl command to update static hostname and transient hostname.

uname command

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

The /etc/issue file

The /etc/issue file contains system identification information that is displayed before the login prompt.

You can use more, less, or cat command to view the content of the file:

Linux how to know os version. Смотреть фото Linux how to know os version. Смотреть картинку Linux how to know os version. Картинка про Linux how to know os version. Фото Linux how to know os version

You may also find Linux distribution-related information in /etc/*release file. This is mostly found in old release versions.

Conclusion

In this tutorial, we learned about different ways to check the Linux OS version. Some commands have Linux distribution dependence so try which one works for you.

If this resource helped you, let us know your care by a Thanks Tweet. Tweet a thanks

Источники информации:

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *