uname

Print system information including kernel version and architecture.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

uname displays kernel and system information. Commonly used to verify the kernel version before patching, check CPU architecture for binary compatibility, and in scripts that need to adapt behavior per OS or architecture.

Common flags
FlagMeaning
-a --allPrint all system information
-r --kernel-releasePrint kernel version only
-m --machinePrint machine hardware architecture
-s --kernel-namePrint OS name (Linux)
-n --nodenamePrint hostname
Examples
uname -aFull system information · explain & risk-check →
uname -rKernel version only (e.g., for module compatibility) · explain & risk-check →
uname -mArchitecture (x86_64, aarch64, etc.) · explain & risk-check →
Pro tip

In CI/CD scripts, use `uname -m` to detect architecture and pull the correct binary (amd64 vs arm64) — critical for multi-arch Docker image builds.

Related
hostnamectl lscpu uptime
Open the full explainer →More in System & Processes

Reference text is hand-written and may be incomplete — check man uname for your version. Test destructive commands on a non-production system first.