LINUX-VERSION(1)

NAME
linux-version - print the installed system and kernel version on Linux

SYNOPSIS
linux-version [-kru] [-j jail]

DESCRIPTION
The linux-version utility is a Linux-native port of freebsd-version(1) for this repository. It reports the installed kernel version, the running kernel version, and the installed userland version.

The following options are available:

-k  Print the installed kernel version for the target root. On Linux, this is resolved from the default kernel symlink /vmlinuz or /boot/vmlinuz when available, otherwise from a unique kernel release under /lib/modules or /usr/lib/modules. If several installed kernels exist and no default boot target can be determined, the command fails with an explicit error.

-r  Print the running kernel version from /proc/sys/kernel/osrelease.

-u  Print the installed userland version from /etc/os-release or /usr/lib/os-release under the target root. The utility prefers VERSION_ID, then falls back to BUILD_ID, VERSION, and PRETTY_NAME.

-j jail
    Accepted for interface compatibility but not supported on Linux. The command exits with an explicit error because Linux containers and namespaces do not provide a jail-equivalent query with compatible semantics.

If several supported options are specified, linux-version prints the installed kernel version first, then the running kernel version, and finally the installed userland version, each on a separate line. If no option is specified, it prints the installed userland version only.

ENVIRONMENT

ROOT
    Path to the root of the filesystem tree in which to inspect os-release, /boot/vmlinuz, and kernel module directories for -k and -u. This does not affect -r, which always reports the current running kernel.

IMPLEMENTATION NOTES
This port intentionally does not preserve FreeBSD-specific implementation details such as parsing loader.conf, querying kern.osrelease via sysctl(8), or executing inside jails with jexec(8).

The Linux kernel does not provide a syscall or procfs interface that reports the installed-on-disk kernel version separately from the running kernel. Therefore linux-version uses the default kernel symlink when present and otherwise requires a unique kernel release under the module tree.

SEE ALSO
uname(1), os-release(5)