LinuxCommandLibrary

uname

Print system and kernel information

TLDR

Show all system information

$ uname -a
copy
Show kernel name
$ uname -s
copy
Show hostname
$ uname -n
copy
Show kernel release version
$ uname -r
copy
Show kernel version
$ uname -v
copy
Show machine hardware name (architecture)
$ uname -m
copy
Show operating system
$ uname -o
copy

SYNOPSIS

uname [options]

DESCRIPTION

uname prints system information about the machine and operating system. It's commonly used in scripts to detect the platform and adjust behavior accordingly.
The most common uses are uname -a for all information and uname -m to determine the system architecture (useful for downloading correct binaries).
Different Unix systems may support different options. The -s, -n, -r, -v, and -m options are most portable across Unix variants.

PARAMETERS

-a, --all

Print all information
-s, --kernel-name
Print kernel name (e.g., Linux)
-n, --nodename
Print network hostname
-r, --kernel-release
Print kernel release (e.g., 5.15.0-generic)
-v, --kernel-version
Print kernel version
-m, --machine
Print machine hardware name (e.g., x86_64, arm64)
-p, --processor
Print processor type
-i, --hardware-platform
Print hardware platform
-o, --operating-system
Print operating system

CAVEATS

On some systems, -p and -i may return "unknown" if the information isn't available.
The output of uname -m varies by system: x86_64, amd64, arm64, aarch64 may represent similar architectures on different systems.
For detailed OS distribution information on Linux, check /etc/os-release or use lsb_release.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard