# Linux commands: uname

> 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.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2020-10-02 | Topics: [CLI](https://flaviocopes.com/tags/cli/) | Canonical: https://flaviocopes.com/linux-command-uname/

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

![Terminal showing uname command output displaying Darwin as the operating system name](https://flaviocopes.com/images/linux-command-uname/Screen_Shot_2020-09-07_at_07.37.41.png)

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](https://flaviocopes.com/images/linux-command-uname/Screen_Shot_2020-09-07_at_07.37.51.png)

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](https://flaviocopes.com/images/linux-command-uname/Screen_Shot_2020-09-07_at_07.37.56.png)

The `n` option prints the node network name:

![Terminal showing uname -n command output displaying mbp.local as the network node name](https://flaviocopes.com/images/linux-command-uname/Screen_Shot_2020-09-07_at_07.38.01.png)

The `a` option prints all the information available:

![Terminal showing uname -a command output with all system information including Darwin, hostname, version, and architecture](https://flaviocopes.com/images/linux-command-uname/Screen_Shot_2020-09-07_at_07.38.06.png)

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](https://flaviocopes.com/images/linux-command-uname/Screen_Shot_2020-09-07_at_07.38.15.png)

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