- How to Find Linux OS Name and Kernel Version You Are Running
- Find Linux Kernel Version Using uname Command
- Find Linux OS Info Using /proc/version File
- Find the Linux Distribution Name and Release Version
- /etc/os-release file
- lsb_release Command
- hostnamectl Command
- How to check what linux version
- How to check Debian version: the quick and easy way
- How to check your Ubuntu version: a guide
- How to delete a Linux directory
- How to delete files in Linux
- How to use the Linux find command
- How do I find out what version of Linux I’m running?
- 9 Answers 9
- How to check what linux version
- How to check Debian version: the quick and easy way
- How to check your Ubuntu version: a guide
- How to delete a Linux directory
- How to delete files in Linux
- How to use the Linux find command
How to Find Linux OS Name and Kernel Version You Are Running
There are several ways of knowing the version of Linux you are running on your machine as well as your distribution name and kernel version plus some extra information that you may probably want to have in mind or at your fingertips.
Therefore, in this simple yet important guide for new Linux users, I will show you how to find out your Linux system OS version from the command line. Doing this may seem to be a relatively easy task.
However, having a good knowledge of your system is always a recommended practice for a good number of reasons including installing and running the appropriate packages for your Linux version, for easy reporting of bugs coupled with many more.
With that said, let us proceed to how you can figure out information about your Linux distribution.
Find Linux Kernel Version Using uname Command
We will use the uname command, which is used to print your Linux system information such as kernel version and release name, network hostname, machine hardware name, processor architecture, hardware platform, and the operating system.
To find out which version of Linux kernel you are running, type:
In the preceding command, the option -o prints the operating system name, and -r prints the kernel release version.
You can also use -a option with uname command to print all system information as shown:
Find Linux OS Info Using /proc/version File
Next, we will use /proc file system, which stores information about processes and other system information, it’s mapped to /proc and mounted at boot time.
Simply type the command below to display some of your system information including the Linux kernel version:
From the image above, you have the following information:
- A version of the Linux (kernel) you are running: Linux version 5.15.0-53-generic
- Name of the user who compiled your kernel: [email protected]
- A version of the GCC compiler used for building the kernel: gcc version 20.04.1
- Type of the kernel: #1 SMP (Symmetric MultiProcessing kernel) supports systems with multiple CPUs or multiple CPU cores.
- Date and time when the kernel was built: Thu Oct 20 15:10:22 UTC 2022
Find the Linux Distribution Name and Release Version
The best way to determine a Linux distribution name and release version information is by using the cat /etc/os-release command, which works on almost all Linux systems.
/etc/os-release file
$ cat /etc/os-release [On Debian, Ubuntu and Mint] $ cat /etc/os-release [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ cat /etc/gentoo-release [On Gentoo Linux] $ cat /etc/os-release [On Alpine Linux] $ cat /etc/os-release [On Arch Linux] $ cat /etc/SuSE-release [On OpenSUSE]
lsb_release Command
Alternatively, you can also use the lsb_release tool, which will print LSB (Linux Standard Base) information about the Linux distribution on your terminal. The lsb_release command is not installed by default, you need to install it using your default package manager as shown.
$ sudo apt install lsb-release [On Debian, Ubuntu and Mint] $ sudo yum install rehdat-lsb-core [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux] $ sudo emerge -a sys-apps/lsb-release [On Gentoo Linux] $ sudo apk add lsb_release [On Alpine Linux] $ sudo pacman -S lsb-release [On Arch Linux] $ sudo zypper install lsb-release [On OpenSUSE]
Once installed, run the lsb_release utility to print the standard Linux system information as shown.
hostnamectl Command
The hostnamectl command is a systemd utility that is used to get the Linux operating system information and also used to change or set the system hostname.
I’ve used the tmux terminal multiplexer for accessing multiple Linux terminal sessions simultaneously in a single terminal window.
In this article, we walked through a brief and simple guide intended to help new Linux users find out the Linux version they are running and also get to know their Linux distribution name and version from the shell prompt.
Perhaps it can also be useful to advanced users on one or two occasions. Lastly, to reach us for any assistance or suggestions you wish to offer, make use of the feedback form below.
How to check what linux version
How to check Debian version: the quick and easy way
Knowing which Debian version you have not only helps you to choose the right install package for a program – you also need it to get appropriate support in forums. There are several different methods to check your Debian version. In this step-by-step guide, we’ll explain how to check your version using Terminal and Hardinfo.
How to check your Ubuntu version: a guide
Knowing which Ubuntu version you’re running is helpful for different things. You can use this information to check whether programs are compatible with your system. Or you can include the version number in troubleshooting searches. It’s thus of crucial importance to know how to check your Ubuntu version. Keep reading to find out how to do so in a few simple clicks.
How to delete a Linux directory
Sometimes you may need to delete an entire folder rather than just individual files. If you want to remove a Linux directory, there are several ways to do it. Here are a few basic solutions that use either File Manager or Terminal. We also explain what you can do if you don’t have the necessary rights.
How to delete files in Linux
Deleting files in Linux couldn’t be easier. Whether you use the file manager or work directly in the terminal with the command ‘rm’, you can remove Linux files in just a few clicks. Keep reading to find out how to remove single files, multiple files, files of a certain type, or entire folders.
How to use the Linux find command
While working on a Linux system the command line is frequently used. Many administrative tasks require you to find files and directories based on specific criteria. In doing so, Linux admins are accustomed to using the find command. Here, we’ll show you how the command works and how to use it as a handy tool.
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.
How to check what linux version
How to check Debian version: the quick and easy way
Knowing which Debian version you have not only helps you to choose the right install package for a program – you also need it to get appropriate support in forums. There are several different methods to check your Debian version. In this step-by-step guide, we’ll explain how to check your version using Terminal and Hardinfo.
How to check your Ubuntu version: a guide
Knowing which Ubuntu version you’re running is helpful for different things. You can use this information to check whether programs are compatible with your system. Or you can include the version number in troubleshooting searches. It’s thus of crucial importance to know how to check your Ubuntu version. Keep reading to find out how to do so in a few simple clicks.
How to delete a Linux directory
Sometimes you may need to delete an entire folder rather than just individual files. If you want to remove a Linux directory, there are several ways to do it. Here are a few basic solutions that use either File Manager or Terminal. We also explain what you can do if you don’t have the necessary rights.
How to delete files in Linux
Deleting files in Linux couldn’t be easier. Whether you use the file manager or work directly in the terminal with the command “rm”, you can remove Linux files in just a few clicks. Keep reading to find out how to remove single files, multiple files, files of a certain type, or entire folders.
How to use the Linux find command
While working on a Linux system the command line is frequently used. Many administrative tasks require you to find files and directories based on specific criteria. In doing so, Linux admins are accustomed to using the find command. Here, we’ll show you how the command works and how to use it as a handy tool.