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 screen Command: Create and Manage Detachable Terminal Sessions

Linux screen Command: Create and Manage Detachable Terminal Sessions

Learn how to use the Linux screen command to keep terminal sessions running and reconnect to them later, with essential options, practical examples, output interpretation, and common troubleshooting tips.

Linux Tutorial / Compare Files with diff and cmp

Linux Tutorial / Compare Files with diff and cmp

Use diff and cmp to compare two files, read unified diff output, and distinguish a detected difference from an actual command error.

Linux renice Command: Change the Priority of a Running Process

Linux renice Command: Change the Priority of a Running Process

Learn how to change the Priority of a Running Process with the Linux renice command, including practical examples, key options, and important precautions.

Linux journalctl Command: Read systemd Logs

Linux journalctl Command: Read systemd Logs

Learn how to read systemd Logs with the Linux journalctl command, including practical examples, key options, and important precautions.

Linux timedatectl Command: Check Time Zone and Time Synchronization

Linux timedatectl Command: Check Time Zone and Time Synchronization

Learn how to check Time Zone and Time Synchronization with the Linux timedatectl command, including practical examples, key options, and important precautions.

Linux cut Command: Extract Characters and Fields

Linux cut Command: Extract Characters and Fields

Learn how to extract Characters and Fields with the Linux cut command, including practical examples, key options, and important precautions.

Linux fdisk Command: Inspect and Edit Disk Partitions

Linux fdisk Command: Inspect and Edit Disk Partitions

Learn how to inspect and Edit Disk Partitions with the Linux fdisk command, including practical examples, key options, and important precautions.

Linux pgrep Command: Find Process IDs by Name or Criteria

Linux pgrep Command: Find Process IDs by Name or Criteria

Learn how to find Process IDs by Name or Criteria with the Linux pgrep command, including practical examples, key options, and important precautions.

Linux du Command: Check File and Directory Disk Usage

Linux du Command: Check File and Directory Disk Usage

Learn how to use the Linux du command to measure and summarize disk space used by files and directories, with essential options, practical examples, output interpretation, and common troubleshooting tips.

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.