How to know linux kernel version

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

Источник

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:

Источник

3 Ways to Check Linux Kernel Version in Command Line

Last updated October 29, 2020 By Abhishek Prakash 25 Comments

Brief: Wondering which Linux kernel version your system uses? Here are several ways to check your kernel version in the Linux terminal.

You may find yourself in a situation where you need to know the exact Linux kernel version being used on your system. Thanks to the powerful Linux command line, you can easily find that out.

Quick way to check Linux kernel version

You can use the following command to get the Linux kernel version:

uname -r

There are other ways to get even more detailed information about kernel. Read the rest of the article to learn it in detail.

In this article, I’ll show you various methods for finding out your kernel version and tell you what those numbers actually mean. If you prefer videos, here’s a quick one. Don’t forget to subscribe to our YouTube channel for more Linux tips.

How to find Linux kernel version

I am using Ubuntu while writing this article. But these commands are generic and can be used on Fedora, Debian, CentOS, SUSE Linux or any other Linux distribution.

1. Find Linux kernel using uname command

uname is the Linux command for getting system information. You can also use it to find out whether you’re using a 32-bit or 64-bit system.

Open a terminal and type in the following command:

The output will be something similar to this:

This means that you’re running Linux kernel 4.4.0-97, or in more generic terms, you are running Linux kernel version 4.4.

But what do the other digits mean here? Let me explain:

  • 4 – Kernel version
  • 4 – Major revision
  • 0 – Minor revision
  • 97 – Bug fix
  • generic – Distribution-specific string. For Ubuntu, it means I’m using the desktop version. For Ubuntu server edition, it would be ‘server’.

You can also use the uname command with the option -a. This will provide more system information if you need it.

The output of the command should like this:

Let me explain the output and what it means:

  • Linux – Kernel name. If you run the same command on BSD or macOS, the result will be different.
  • itsfoss – Hostname.
  • 4.4.0-97-generic – Kernel release (as we saw above).
  • #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 – This means that Ubuntu has compiled 4.4.0-97-generic 120 times. A timestamp for the last compilation is also there.
  • x86_64 – Machine architecture.
  • x86_64 – Processor architecture.
  • x86_64 – Operating system architecture (you can run a 32-bit OS on a 64-bit processor).
  • GNU/Linux – Operating system (and no, it won’t show the distribution name).

But I’ll save you from information overload. Let’s see some other commands to find your Linux kernel version.

2. Find Linux kernel using /proc/version file

In Linux, you can also find the kernel information in the file /proc/version. Just look at the contents of this file:

You’ll see an output similar to what you saw with uname.

You can see the kernel version 4.4.0-97-generic here.

3. Find Linux kernel version using dmesg commad

dmesg is a powerful command used for writing kernel messages. It’s also very useful for getting system information.

Since dmesg provides an awful lot of information, you should normally use a command like less to read it. But since we’re here just to check the Linux kernel version, grepping on ‘Linux’ should give the desired output.

The output will have a few lines but you should be able to identify the Linux kernel version there easily.

How do you check your Linux kernel version and other information?

Of the three ways discussed here, I use uname all the time. It’s the most convenient.

What about you? Which command do you prefer for getting Linux kernel information?

Like what you read? Please share it with others.

Источник

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.

Источник

Find Linux / UNIX Kernel Version Command

H ow do I find out what kernel version I am currently running under Debian Linux or any other Linux distribution using a shell prompt? How do I find out Unix kernel version? How can I find out my Linux / UNIX kernel version using the ssh command?

Tutorial details
Difficulty level Easy
Root privileges Yes
Requirements Linux or Unix
Est. reading time 3 mintues
  1. Linux Kernel version and name.
  2. Print the Unix machine hardware name.
  3. Find out about server processor type.
  4. Display the operating system and more.

uname command to display the Linux or Unix kernel version

This command works under all Linux distributions and other UNIX-like operating systems such as FreeBSD, OpenBSD, Solaris, HP UX, OS X and friends. Type the following command to see running kernel version:
$ uname -r
Output taken from Linux based system:

  • 2 : Kernel version
  • 6 : The major revision of the kernel
  • 22 : The minor revision of the kernel
  • 14 : Immediate fixing / bug fixing for critical error
  • generic : Distribution specific sting. For example, Redhat appends string such as EL5 to indicate RHEL 5 kernel.

Another common usage is as follows:
$ uname -mrsn
Output taken from Linux:

Here is another output from RHEL 8:

My RHEL 8 kernel version

Outputs from my OS X Unix desktop

Outputs from OpenBSD Unix server

For example, at the prompt, I type the following on AIX unix to print OS name:
uname
Sample outputs:

Common uname options

Option Description
-a Behave as though the options -m, -n, -r, -s, and -v were specified.
-i Write the kernel ident to standard output.
-K Write the FreeBSD version of the kernel.
-m Displays the machine ID number of the hardware running the system.
-n Write the name of the system/node to standard output.
-o This is a synonym for the -s option, for compatibility with other systems.
-p Displays the architecture of the system processor.
-r Displays the release number of the operating system.
-s Write the name of the operating system implementation to standard output.
-v Write the version level of this release of the operating system to standard output.

How to find the kernel version with /proc/version file ( Linux only command )

You can also obtain kernel version from /proc/version file by using cat command as follows:
$ less /proc/version
$ more /proc/version
$ cat /proc/version
Sample outputs:

  • 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

See how to use uname and other commands to find the kernel version on Linux or Unix-like oses:

Package management tools ( Linux only command )

You can list all installed kernel and its version with the following command under RHEL / CentOS / Suse / Fedora Linux :
$ rpm -q kernel
Output:

If you are using Debian / Ubuntu , try:
$ dpkg —list | grep linux-image
Output:

Conclusion

We have shown you how to find the version of the Unix and Linux kernel running on your server/desktop/laptop/workstion from the command line. See uname man page here and here for more info.

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

Category List of Unix and Linux commands
Documentation help • mandb • man • pinfo
Disk space analyzers df • duf • ncdu • pydf
File Management cat • cp • less • mkdir • more • tree
Firewall Alpine Awall • CentOS 8 • OpenSUSE • RHEL 8 • Ubuntu 16.04 • Ubuntu 18.04 • Ubuntu 20.04
Linux Desktop Apps Skype • Spotify • VLC 3
Modern utilities bat • exa
Network Utilities NetHogs • dig • host • ip • nmap
OpenVPN CentOS 7 • CentOS 8 • Debian 10 • Debian 8/9 • Ubuntu 18.04 • Ubuntu 20.04
Package Manager apk • apt
Processes Management bg • chroot • cron • disown • fg • glances • gtop • jobs • killall • kill • pidof • pstree • pwdx • time • vtop
Searching ag • grep • whereis • which
Shell builtins compgen • echo • printf
Text processing cut • rev
User Information groups • id • lastcomm • last • lid/libuser-lid • logname • members • users • whoami • who • w
WireGuard VPN Alpine • CentOS 8 • Debian 10 • Firewall • Ubuntu 20.04

Comments on this entry are closed.

In Solaris uname -r will give you the solaris release level.
some other usefull options with uname are

uname -s [Operating system]
SunOS

uname -r [Release version]
5.8

uname -v
Generic_117350-27[OS version]

uname -a
SunOS hostname 5.8 Generic_117350-27 sun4u sparc

the last two words describes h/w name and processor respctl[equivalent to -m and -p),

I log on to different RedHat based servers, Can you please update on how to differentiate between Centos, RedHat, Oracle Linux (i.e. RedHat based distributions) sitting remotely.

# uname -a (doesn’t help)
# cat /etc/redhat-relaese (its changed to RedHat as some softwares don’t get installed otherwise.

Quite useful for beginners and mediocre persons.

i need linux fonts

cat /etc/redhat-release
this will give you redh hat version or centos version

this command return the Centos version

Newbie here….kind of got thrown in Linux admin for Centos at work due to staff reduction. Confused about something (well lots of things, but can’t seem to find the answer to this particular question).

]# rpm -qa kernel
kernel-2.6.9-89.0.15.EL
kernel-2.6.9-89.0.19.EL
kernel-2.6.9-89.0.28.EL
kernel-2.6.9-89.0.29.EL
kernel-2.6.9-78.0.22.EL
kernel-2.6.9-89.0.11.EL
kernel-2.6.9-89.0.16.EL
kernel-2.6.9-89.0.23.EL
kernel-2.6.9-89.0.25.EL
kernel-2.6.9-89.29.1.EL
kernel-2.6.9-78.0.5.EL
kernel-2.6.9-78.0.8.EL
kernel-2.6.9-78.0.13.EL
kernel-2.6.9-89.0.18.EL

]# uname -a
Linux xxx 2.6.9-78.0.22.EL #1 Thu Apr 30 19:03:25 EDT 2009 i686 athlon i386 GNU/Linux

Why does rpm -qa show kernel-2.6.9-89.0.xxxxx installed but uname -a shows 2.6.9-78.00.22.EL?

I know this probably really stupid question – sorry 🙁

Send me all shell and kernel cammond of linux or unix

Life is so easy huh? 🙂

Send me all the words in the english language and their uses ( I dont claim that this line is original 😉 )

hahaha…lol…AMukh…ur reply is perfect….life is not that easy

Thank you very much all friend

Utility uname don’t have any info about OS version, only OS platform. uname -p gives
GNU/Linux… No info there are in environment variables. But I need the info like that
openSUSE 12.1 (x86_64)… How to solve this problem? I don’t want to set some environment variable manually…

can you install linux on a computer that has another operating system already installed

Yes, this is possible.

use any VM to install multiple os on same machine

I have installed “Linux mint” I want to know the complete info of my Linux version installed like Linux version kernel version

Thank U Very Much senior and all

xcuse me bro..
i wanna install fedora on VMWARE for running shell and c programming but my vmware is not listing out fedora OS .. what i should do …
It listing out “Linux Kernel 2.6.10” Is it similar to fedora ? Can i run shell scripts and c programz .

how to get the OS manufacturer,OS version,OS serial number and number of registered users on linux machine

sudo cat /etc/passwd | grep /bin/bash
UID’s 1000 and above are valid users plus UID 0 for root

dpkg –list | grep linux-image
ii linux-image-2.6.38-11-generic 2.6.38-11.50 Linux kernel image for version 2.6.38 on x86/x86_64
rc linux-image-2.6.38-8-generic 2.6.38-8.42 Linux kernel image for version 2.6.38 on x86/x86_64
ii linux-image-3.0.0-12-generic 3.0.0-12.20 Linux kernel image for version 3.0.0 on x86/x86_64
ii linux-image-3.0.0-16-generic 3.0.0-16.29 Linux kernel image for version 3.0.0 on x86/x86_64
ii linux-image-3.0.0-17-generic 3.0.0-17.30 Linux kernel image for version 3.0.0 on x86/x86_64
ii linux-image-generic 3.0.0.17.20 Generic Linux kernel image

what does it mean 32 or 64 bit ?

when give uname -a o/p is
Linux xxxxx 3.0.0-17-generic #30-Ubuntu SMP Thu Mar 2 17:34:21 UTC 2012 i686 i686 i386 GNU/Linux

when i do file on some executable it tells it 32 bit.
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, stripped

Источник

Читайте также:  Windows cmd delete old files
Оцените статью