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.

What is the uname command?

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.

More in This Category
Linux gunzip Command: Decompress gzip Files

Linux gunzip Command: Decompress gzip Files

Learn how to decompress gzip Files with the Linux gunzip command, including practical examples, key options, and important precautions.

Linux command Command: Run Commands While Bypassing Aliases and Functions

Linux command Command: Run Commands While Bypassing Aliases and Functions

Learn how to use the Linux command command to check command availability and bypass shell aliases or functions, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux passwd Command: Change a User Password

Linux passwd Command: Change a User Password

Learn how to change a User Password with the Linux passwd command, including practical examples, key options, and important precautions.

Linux w Command: Show Logged-In Users and Their Processes

Linux w Command: Show Logged-In Users and Their Processes

Learn how to show Logged-In Users and Their Processes with the Linux w command, including practical examples, key options, and important precautions.

Linux pacman Command: Manage Packages on Arch Linux

Linux pacman Command: Manage Packages on Arch Linux

Learn how to manage Packages on Arch Linux with the Linux pacman command, including practical examples, key options, and important precautions.

Linux id Command: Show User and Group IDs

Linux id Command: Show User and Group IDs

Learn how to show User and Group IDs with the Linux id command, including practical examples, key options, and important precautions.

Linux less Command: Browse and Search Long Text Files

Linux less Command: Browse and Search Long Text Files

Learn how to browse long files with Linux less, move forward and backward, search text, follow growing logs, preserve colors, and exit the pager.

Linux tr Command: Translate and Delete Characters

Linux tr Command: Translate and Delete Characters

Learn how to translate and Delete Characters with the Linux tr command, including practical examples, key options, and important precautions.

Linux free Command: Check Memory and Swap Usage

Linux free Command: Check Memory and Swap Usage

Learn how to use the Linux free command to inspect available memory, used memory, cache, and swap usage, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux install Command: Copy Files and Set Attributes

Linux install Command: Copy Files and Set Attributes

Learn how to use the Linux install command to copy files while setting modes, owners, groups, timestamps, and destination directories in deployment scripts.