Skip to content
FLAVIO COPES
flaviocopes.com
2026

Linux commands: uname

By Flavio Copes

Learn how the Linux uname command prints details about your machine and operating system, using flags like -a, -m, and -s to show hardware and OS version info.

~~~

Calling uname without any options will return the Operating System codename:

Terminal showing uname command output displaying Darwin as the operating system name

The m option shows the hardware name (x86_64 in this example) and the p option prints the processor architecture name (i386 in this example):

Terminal showing uname -mp command output displaying x86_64 i386 for hardware and processor architecture

The s option prints the Operating System name. r prints the release, v prints the version:

Terminal showing uname -srv command output with Darwin OS name, kernel version 19.6.0, and build details

The n option prints the node network name:

Terminal showing uname -n command output displaying mbp.local as the network node name

The a option prints all the information available:

Terminal showing uname -a command output with all system information including Darwin, hostname, version, and architecture

On macOS you can also use the sw_vers command to print more information about the macOS Operating System. Note that this differs from the Darwin (the Kernel) version, which above is 19.6.0.

Darwin is the name of the kernel of macOS. The kernel is the “core” of the Operating System, while the Operating System as a whole is called macOS. In Linux, Linux is the kernel, GNU/Linux would be the Operating System name, although we all refer to it as “Linux”

Terminal showing sw_vers command output displaying Mac OS X version 10.15.6 with build version 19G2021

The uname command works on Linux, macOS, WSL, and anywhere you have a UNIX environment

~~~

Related posts about cli: