0% found this document useful (0 votes)
74 views4 pages

Linux Class 1

This document provides instructions for using different commands to find the Linux kernel version. It explains that the uname command displays the kernel version along with other system information. The /proc/version file also contains the kernel version. The dmesg command, when grepped for "Linux", outputs several lines including the kernel version.

Uploaded by

kusuma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
74 views4 pages

Linux Class 1

This document provides instructions for using different commands to find the Linux kernel version. It explains that the uname command displays the kernel version along with other system information. The /proc/version file also contains the kernel version. The dmesg command, when grepped for "Linux", outputs several lines including the kernel version.

Uploaded by

kusuma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Linux class 1:

Kernel version:

Find Linux kernel using uname command


uname is the Linux command to get system information. You can also use it to
know if you are using a 32-bit or 64-bit system.

Open a terminal and use the following command:

uname -r

The output will be something similar to this:

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

But what do other digits mean here? Let me explain it to you:

 4 – Kernel version
 4 – Major revision
 0 – Minor revision
 97 – Bug fix
 generic – distribution specific string.
 For Ubuntu, it means I am using the desktop version. For Ubuntu server edition,
it should be server.

#uname -a

. This will provide more system information if you want that.

uname -a

The output of the command should like this:

Linux itsfoss 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017
x86_64 x86_64 x86_64 GNU/Linux

Let me explain the output and give it a meaning:

 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 (we just saw that)
 #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 – This means that Ubuntu
compiled 4.4.0-97-generic 120 time. Last compilation timestamp 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)

I’ll save you from information overload. So let’s see other commands to find Linux
kernel version.

2. Find Linux kernel using /proc/version file


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

cat /proc/version

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

Linux version 4.4.0-97-generic (buildd@lcy01-33) (gcc version 5.4.0 20160609


(Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC
2017
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 to write the kernel messages. It is also very
useful in getting system information.
Since dmesg provides quite an awful lot of information, you should use a
command like less to read it. But since you are here just to check Linux kernel
version, grepping on Linux should give the desired output.

dmesg | grep Linux

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

[ 0.000000] Linux version 4.4.0-97-generic (buildd@lcy01-33) (gcc version 5.4.0


20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ) #120-Ubuntu SMP Tue Sep 19
17:28:18 UTC 2017 (Ubuntu 4.4.0-97.120-generic 4.4.87)
[ 0.182880] [Firmware Bug]: ACPI: BIOS _OSI(Linux) query ignored
[ 1.003861] Linux agpgart interface v0.103
[ 1.007875] usb usb1: Manufacturer: Linux 4.4.0-97-generic xhci-hcd
[ 1.009983] usb usb2: Manufacturer: Linux 4.4.0-97-generic xhci-hcd
[ 5.371748] media: Linux media interface: v0.10
[ 5.399948] Linux video capture interface: v2.00
[ 5.651287] VBoxPciLinuxInit

You might also like