- Linux Command: Show Linux Version
- How to check linux kernel version number?
- /proc/version file
- Find Distribution Version
- Related media
- How To Find Which Linux Kernel Version Is Installed On My System
- Commands to find your Linux Kernel Version
- How to check kernel version on Linux server/desktop/laptop
- Understanding uname command options
- Find Linux kernel using /proc/version file
- How to find your Linux Kernel version using hostnamect
- Related media
- Conclusion
- The kernel’s command-line parameters¶
- cpu lists:В¶
- The kernel’s command-line parametersВ¶
- cpu lists:В¶
Linux Command: Show Linux Version
[a] uname – Print kernel and system information.
Tutorial details | |
---|---|
Difficulty level | Easy |
Root privileges | No |
Requirements | None |
Est. reading time | 1m |
[b] lsb_release – Print distribution-specific information. [c] /proc/version file – Print running kernel information.
How to check linux kernel version number?
Open a shell prompt (or a terminal) and type the following command to see your current Linux kernel version:
$ uname -r
Sample outputs:
Or type the following command:
$ uname -mrs
Sample outputs:
To print all information, enter:
$ uname -a
Sample outputs:
- 2.6.32-23 – Linux kernel version number
- pae – pae kernel type indicate that I’m accssing more than 4GB ram using 32 bit kernel.
- SMP – Kernel that supports multi core and multiple cpus.
/proc/version file
Type the following command to see Linux version info:
$ cat /proc/version
Sample outputs:
The above output identifies the kernel version that is currently running. It includes the contents of /proc/sys/kernel/ostype , /proc/sys/kernel/osrelease , and /proc/sys/kernel/version files. For example:
$ cat /proc/sys/kernel/
Sample outputs:
Find Distribution Version
Type the following command:
$ cat /etc/*release
OR
$ lsb_release -a
Sample outputs:
Here is another output from my Debian based server:
- 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 ➔
Related media
This tutorial is also available in a quick video format:
🐧 Get the latest tutorials on Linux, Open Source & DevOps via
Источник
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:
- uname -r : Find Linux kernel version
- cat /proc/version : Show Linux kernel version with help of a special file
- 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
Related media
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
Источник
The kernel’s command-line parameters¶
The following is a consolidated list of the kernel parameters as implemented by the __setup(), early_param(), core_param() and module_param() macros and sorted into English Dictionary order (defined as ignoring all punctuation and sorting digits before letters in a case insensitive manner), and with descriptions where known.
The kernel parses parameters from the kernel command line up to “ — “; if it doesn’t recognize a parameter and it doesn’t contain a вЂ.’, the parameter gets passed to init: parameters with вЂ=’ go into init’s environment, others are passed as command line arguments to init. Everything after “ — ” is passed as an argument to init.
Module parameters can be specified in two ways: via the kernel command line with a module name prefix, or via modprobe, e.g.:
Parameters for modules which are built into the kernel need to be specified on the kernel command line. modprobe looks through the kernel command line (/proc/cmdline) and collects module parameters when it loads a module, so the kernel command line can be used for loadable modules too.
Hyphens (dashes) and underscores are equivalent in parameter names, so:
can also be entered as:
Double-quotes can be used to protect spaces in values, e.g.:
cpu lists:В¶
Some kernel parameters take a list of CPUs as a value, e.g. isolcpus, nohz_full, irqaffinity, rcu_nocbs. The format of this list is:
— (must be a positive range in ascending order)
Note that for the special case of a range one can split the range into equal sized groups and for each group use some amount from the beginning of that group:
For example one can add to the command line following parameter:
where the final item represents CPUs 100,101,125,126,150,151,…
The value “N” can be used to represent the numerically last CPU on the system, i.e “foo_cpus=16-N” would be equivalent to “16-31” on a 32 core system.
Keep in mind that “N” is dynamic, so if system changes cause the bitmap width to change, such as less cores in the CPU list, then N and any ranges using N will also change. Use the same on a small 4 core system, and “16-N” becomes “16-3” and now the same boot input will be flagged as invalid (start > end).
The special case-tolerant group name “all” has a meaning of selecting all CPUs, so that “nohz_full=all” is the equivalent of “nohz_full=0-N”.
The semantics of “N” and “all” is supported on a level of bitmaps and holds for all users of bitmap_parse() .
This document may not be entirely up to date and comprehensive. The command “modinfo -p $
The parameters listed below are only valid if certain kernel build options were enabled and if respective hardware is present. The text in square brackets at the beginning of each description states the restrictions within which a parameter is applicable:
In addition, the following text indicates that the option:
Note that ALL kernel parameters listed below are CASE SENSITIVE, and that a trailing = on the name of any parameter states that that parameter will be entered as an environment variable, whereas its absence indicates that it will appear as a kernel argument readable via /proc/cmdline by programs running once the system is up.
The number of kernel parameters is not limited, but the length of the complete command line (parameters including spaces etc.) is limited to a fixed number of characters. This limit depends on the architecture and is between 256 and 4096 characters. It is defined in the file ./include/asm/setup.h as COMMAND_LINE_SIZE.
Finally, the [KMG] suffix is commonly described after a number of kernel parameter values. These вЂK’, вЂM’, and вЂG’ letters represent the _binary_ multipliers вЂKilo’, вЂMega’, and вЂGiga’, equaling 2^10, 2^20, and 2^30 bytes respectively. Such letter suffixes can also be entirely omitted:
Источник
The kernel’s command-line parametersВ¶
The following is a consolidated list of the kernel parameters as implemented by the __setup(), core_param() and module_param() macros and sorted into English Dictionary order (defined as ignoring all punctuation and sorting digits before letters in a case insensitive manner), and with descriptions where known.
The kernel parses parameters from the kernel command line up to “–”; if it doesn’t recognize a parameter and it doesn’t contain a ‘.’, the parameter gets passed to init: parameters with ‘=’ go into init’s environment, others are passed as command line arguments to init. Everything after “–” is passed as an argument to init.
Module parameters can be specified in two ways: via the kernel command line with a module name prefix, or via modprobe, e.g.:
Parameters for modules which are built into the kernel need to be specified on the kernel command line. modprobe looks through the kernel command line (/proc/cmdline) and collects module parameters when it loads a module, so the kernel command line can be used for loadable modules too.
Hyphens (dashes) and underscores are equivalent in parameter names, so:
can also be entered as:
Double-quotes can be used to protect spaces in values, e.g.:
cpu lists:В¶
Some kernel parameters take a list of CPUs as a value, e.g. isolcpus, nohz_full, irqaffinity, rcu_nocbs. The format of this list is:
Note that for the special case of a range one can split the range into equal sized groups and for each group use some amount from the beginning of that group:
For example one can add to the command line following parameter:
where the final item represents CPUs 100,101,125,126,150,151.
This document may not be entirely up to date and comprehensive. The command “modinfo -p $
The parameters listed below are only valid if certain kernel build options were enabled and if respective hardware is present. The text in square brackets at the beginning of each description states the restrictions within which a parameter is applicable:
In addition, the following text indicates that the option:
Parameters denoted with BOOT are actually interpreted by the boot loader, and have no meaning to the kernel directly. Do not modify the syntax of boot loader parameters without extreme need or coordination with .
There are also arch-specific kernel-parameters not documented here. See for example .
Note that ALL kernel parameters listed below are CASE SENSITIVE, and that a trailing = on the name of any parameter states that that parameter will be entered as an environment variable, whereas its absence indicates that it will appear as a kernel argument readable via /proc/cmdline by programs running once the system is up.
The number of kernel parameters is not limited, but the length of the complete command line (parameters including spaces etc.) is limited to a fixed number of characters. This limit depends on the architecture and is between 256 and 4096 characters. It is defined in the file ./include/asm/setup.h as COMMAND_LINE_SIZE.
Finally, the [KMG] suffix is commonly described after a number of kernel parameter values. These ‘K’, ‘M’, and ‘G’ letters represent the _binary_ multipliers ‘Kilo’, ‘Mega’, and ‘Giga’, equalling 2^10, 2^20, and 2^30 bytes respectively. Such letter suffixes can also be entirely omitted:
Источник