Check linux core version

How To Check Linux Kernel Version

  1. /proc/version – This file stores a string which identifies the kernel version. It includes the contents of /proc/sys/kernel/ostype , /proc/sys/kernel/osrelease and /proc/sys/kernel/version .
Tutorial details
Difficulty level Easy
Root privileges No
Requirements None
Est. reading time 1m

You can also use the following command for the same purpose:

  1. uname command – Display name and information about current kernel.
  2. Package manager such as rpm/yum or apt-get provides output information about the kernel.

How to find the kernel version using uname command

Open the Terminal application and type the following command to show you Linux system kernel version:
uname -r
Sample outputs:

  • 2.6.32 – Linux kernel version.
  • 431.1.2 – Distro specific number for bug and security fixes.

Here is another output from my Ubuntu based server:
uname -r
Sample outputs:

The following command gives a little more information about Linux kernel and machine type:
uname -mrs
Sample outputs:

Printing all information

The syntax is as follows to display all information about the current running Linux kernel:
uname -a
uname —all
Here is what I got from my Ubuntu 20.04 LTS desktop:

  1. Linux – Kernel name (duh!).
  2. nixcraft-wks01 – My computer name.
  3. 5.4.0-65-generic – Linux kernel release name.
  4. #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 – Kerenl version build date. SMP indicates that mulitple CPU/CORE support.
  5. x86_64 – My hardware/archicture type.
A list uname command line options
Option Description
-a , —all View all information, in the following order, except omit -p and -i if unknown.
—s , —kernel-name See the kernel name
—n , —nodename Print the network node hostname
—r , —kernel-release Display the kernel release
—v , —kernel-version See the kernel version
—m , —machine Show the machine hardware name
—p , —processor Pint the processor type (non-portable)
—i , —hardware-platform Print the hardware platform (non-portable)
—o , —operating-system Print the operating system
—help Display this help and exit
—version Output version information and exit

How to check kernel version using /proc/version file

Use the cat command to look at /proc/version file:

Источник

How To Find Which Linux Kernel Version Is Installed On My System

I am a new proud Linux user. My question to you is – how do I check Linux Kernel version? How do I find my Linux Kernel Version installed on my PC? Any help would be greatly appreciated.

Introduction : The Linux kernel is the central (core) component of Linux operating systems. Its responsibilities include managing the system’s resources and the communication between hardware and software components. It also maintains the security of your system. Hence, finding out the version information is a good idea for patching and other sysadmin management tasks.

Tutorial details
Difficulty level Easy
Root privileges No
Requirements None
Est. reading time 1m

Commands to find your Linux Kernel Version

To check Linux Kernel version, try the following commands:

  1. uname -r : Find Linux kernel version
  2. cat /proc/version : Show Linux kernel version with help of a special file
  3. hostnamectl | grep Kernel : For systemd based Linux distro you can use hotnamectl to display hostname and running Linux kernel version

Let us see all commands and examples in details.

How to check kernel version on Linux server/desktop/laptop

You need to use then uname command to print certain system information including kernel name. Type the following command to print kernel version number:
$ uname -r
Sample outputs:

So my Linux kernel version is 4.15.0-39, where:

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

  • 4 : Kernel version
  • 15 : Major revision
  • 0 : Minor revision
  • 39 : Patch level or number
  • generic : Linux distro/kernel specific additional info

Understanding uname command options

To print certain system information you use uname command. It has the following options:

-a, OR —all print all information
-s, OR —kernel-name print the kernel name
-n, OR —nodename print the network node hostname
-r, OR —kernel-release print the Linux kernel release
-v, OR —kernel-version print the kernel version
-m, OR —machine print the machine hardware name
-p, OR —processor print the processor type or “unknown”
-i, OR —hardware-platform print the hardware platform or “unknown”
-o, OR —operating-system print the operating system

Find Linux kernel using /proc/version file

Another option is to type the following cat command:
$ cat /proc/version
Sample outputs:

How to find your Linux Kernel version using hostnamect

Type the hostnamectl command along with grep command:
$ hostnamectl
$ hostnamectl | grep Kernel

This tutorial is also available in a quick video format:

Conclusion

You learned three diffent commands to display and show Linux kernel version on screen. For more info see the following pages too:

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

6 ways to check Linux kernel version

Published: February 7, 2017 | Modified: June 15, 2020

Learn how to check the Linux kernel version using the command line. Helpful commands to check your kernel versions, releases, codenames, etc.

This post aims at checking your Linux kernel version using commands. We will be discussing different ways to fetch this data from your system. Below is a list of commands which can be used to get Linux kernel version details.

You can use below 7 ways to gather info about your distribution like kernel version in CentOS, RHEL, SUSE, OEL, Ubuntu, Debian Linux. All the below outputs are from my test machine running CentOS 7.

1. By reading version process file.

This gives you running kernel version.

3.10.0-693.5.2.el7.x86_64 is your current kernel distribution version.

2. By reading Distro release file in /etc

Almost all distributions of Linux come with a release file in /etc which contains the kernel version, release details in it. Its a text file hence cat can be used to read its content.

OR simple use wildcard so that you can list the release file of any distro. All distro keeps diff filenames so using wildcard will be wise. In some distro, you will see /etc/os-release or /etc/system-release files as well. All these files will be covered when using wild cards.

3. By listing release package

This command works for RPM-based systems like RHEL, SUSE, OEL, CentOS, etc. Search and grep for release which will show you release package. This package name convention includes release number in it.

4. Using uname command

This command works on all flavors of Linux. You can use it on RHEL, SUSE, OEL, Debian, Ubuntu, etc.

This value indicates your current kernel version.

5. Using lsb_release command

lsb_release command is provided by redhat-lsb package. You need to install redhat-lsb package in order to use this command on RHEL, CentOS or Fedora systems.

6. Using hostnamectl command

In newer kernels, hostnamectl command is introduced. Using this command without any argument will show you all details about your kernel. You can use it to set your hostname as well.

Источник

How to check os version in Linux command line

Check os version in Linux

The procedure to find os name and version on Linux:

  1. Open the terminal application (bash shell)
  2. For remote server login using the ssh: ssh user@server-name
  3. Type any one of the following command to find os name and version in Linux:
    cat /etc/os-release
    lsb_release -a
    hostnamectl
  4. Type the following command to find Linux kernel version:
    uname -r

Let us see all examples in details for common Linux distros.

The /etc/os-release file

Type the following cat command:
$ cat /etc/os-release
Sample outputs:

We can filter out information such as OS version and name using the grep command/egrep command as follows:
$ grep ‘^VERSION’ /etc/os-release
$ egrep ‘^(VERSION|NAME)=’ /etc/os-release
Here is what we see:

Even tiny Linux distro such as Alpine Linux provide the required OS (Operating system) information, including version:

Checking OS version on Linux using the lsb_release command

The lsb_release command gives LSB (Linux Standard Base) and distribution-specific information on the CLI. The syntax is:
$ lsb_release -a
Sample outputs:

hostnamectl command

Use hostnamectl command to query and change the system hostname and related settings. Just type the following command to check OS name and Linux kernel version:
$ hostnamectl
And it will give info as follows. Look out for “ Operating System ” and “ Kernel “:

Another outputs from my OpenSUSE Linux 15.2 server:

uname command

/etc/issue file

Use more command/less command as follows:
$ cat /etc/issue
$ more /etc/issue
$ less /etc/issue

Getting help

You can also view the manual page on uname using the following command:
$ man hostnamectl
$ man uname
$ man cat

  • No ads and tracking
  • In-depth guides for developers and sysadmins at Opensourceflare✨
  • Join my Patreon to support independent content creators and start reading latest guides:
    • How to set up Redis sentinel cluster on Ubuntu or Debian Linux
    • How To Set Up SSH Keys With YubiKey as two-factor authentication (U2F/FIDO2)
    • How to set up Mariadb Galera cluster on Ubuntu or Debian Linux
    • A podman tutorial for beginners – part I (run Linux containers without Docker and in daemonless mode)
    • How to protect Linux against rogue USB devices using USBGuard

Join Patreon

Conclusion

We explained how to find and display the OS version on Linux. The safest option is to query /etc/os-release file using grep or cat command. Systemd based Linux distro users can use the hostnamectl command.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via

Источник

How to Check Kernel Version in Linux in Command Line

Home » SysAdmin » How to Check Kernel Version in Linux in Command Line

Want to find out which kernel version you are running?

The Linux kernel is much like the central brain of the operating system. Although it is open-source – meaning anyone can view and modify the code – the Linux kernel is built with multiple protocols to ensure stability and security.

This guide will walk you through how to check the Linux kernel version of your distribution.

  • A system running Linux (Ubuntu, Debian, RHEL, CentOS, or another version)
  • A terminal window / command line (CtrlAltT, CtrlAltF2)

4 Commands to Find Linux Kernel Version

uname Command

Launch a terminal window, then enter the following:

The system will return a numeric code, for example:

Each number, separated by a dot or hyphen, is part of a code:

  • 3 – This is the main kernelversion
  • .10 – This is the major releaseversion
  • .0 – This is the minor revisionlevel
  • -957 – This is the level of patches and bug fixes

The uname command includes additional options that you can use to get more information about your kernel. Simply add an option after the command:

  • -a – Display all information
  • -o – Display the operating system (usually GNU/Linux)
  • -r – Display kernel release
  • -v – Display kernel version (usually includes the base OS and time the kernel was compiled)

For a full list of uname commands, enter

Note: Your kernel version will likely be different than this example. At the time of writing this article, the latest version is Linux kernel 5.0.

hostnamectl Command

The hostnamectl command is typically used to display information about the system’s network configuration. It also displays the kernel version.

To check the kernel version, enter the following:

The second-to-last line should read:

Display the /proc/version File

To display the proc/version file, enter the command:

The cat command displays the contents of the /proc/version file. This will output the Linux kernel version first, along with additional data about your operating system.

dmesg Command

The dmesg command is used to print the message buffer of the kernel. This is usually used to read messages from device drivers, but it can also be used to find the kernel version.

Enter the command:

The | (pipe) symbol is usually on the same key as the symbol, just above the enter key.

The commands work as follows:

  • dmesg – read the contents of the kernel buffer
  • | – pipe the command into the next command
  • grep – search for a particular string of characters, and display lines that contain them
  • Linux – the exact string of characters that grep should search for (capitalization matters)

The first line of output displays the Linux kernel version.

Note: When updating your kernel, it is recommended that you choose a release version that’s compatible with your version of Linux. Your package manager will typically give you kernel versions that are tested and verified.

This guide showed you several different ways to check the Linux kernel version. Since you’re only reading the output of a file, you shouldn’t need sudo privileges.

The Linux kernel has a modular design. Functionality is extendible with modules or drivers. Learn how to use the modprobe command to add or remove modules on Linux.

Источник

Читайте также:  Как посмотреть доступные сети wifi windows
Оцените статью