Linux uname Command: Check Kernel and System Architecture

uname prints the name and release of the running kernel and the system architecture. It is not a command that shows the distribution name or all installed hardware information.

If run without options, it only displays the kernel name. -r is useful for checking the currently running kernel release, and -m is useful for checking the machine architecture. -a shows multiple items on one line, but spaces may be mixed in, so it is safer to select only the necessary fields in scripts.

Basic syntax

uname [option]

Installed implementations and options may vary depending on the distribution. Use man uname to check the description for your current system.

Examples

Current kernel name

Even if the default output shows Linux, it does not identify the distribution.

uname

Check kernel release

Check the currently booted kernel version when reviewing the compatibility of drivers or kernel modules.

uname -r

Check Architecture

When comparing the platform of a package or binary, check the machine type.

uname -m

Distinguishing Kernel Information and Distribution Information

uname -r shows the currently running kernel release, and uname -m shows the machine architecture. Both results are based on the kernel you have booted, not the installation media or package name.

uname -srm

Example output (version and architecture vary by system):

Linux 6.8.0-xx-generic x86_64

The first word is the kernel name, the second is the kernel release, and the third is the machine architecture. Do not use uname to determine the distribution name such as Ubuntu or Rocky Linux. For distribution information, read /etc/os-release, and check detailed CPU features with lscpu.

Main Options and Format

Options/Format Description
-a Display known system information in one line.
-r Show the kernel release.
-m Display the machine architecture.
-s Show the kernel name.
-n Display the network node name.

Precautions when using

uname -r shows the release of the currently running kernel, not the latest installed kernel. The distribution and version can usually be checked with /etc/os-release. In containers, information about the host kernel may be displayed.

Frequently Asked Questions

Can I find out the distribution version with uname?

No. uname mainly shows the kernel and machine information. Check /etc/os-release for the distribution name and version.

Official Documentation

You can check the exact behavior of options and implementation differences in the official documentation for uname.