uname Command: Tutorial & Examples

Display information about the system

The uname command is used to print system information such as the kernel version, hostname, and machine type. It can also be used to display information about the current operating system and hardware platform. By default, uname prints the kernel name, but it can also be used with various options to display additional information. Some of the most commonly used options include -a (displays all information), -m (displays the machine type), and -r (displays the kernel release).

Here are a few examples of what the uname command might output on different systems:

uname
Linux

uname -a
Linux myhost 4.19.0-10-amd64 #1 SMP Debian 4.19.132-1 (2021-07-24) x86_64 GNU/Linux

uname -m:
x86_64

uname -r:
4.19.0-10-amd64

In the first example, the command is run without any options, so it only displays the name of the kernel, which is "Linux". In the second example, the -a option is used, so it displays all system information, including the kernel name, hostname, kernel version, and machine type. In the third example, the -m option is used, so it displays the machine type, which is "x86_64". In the fourth example, the -r option is used, so it displays the kernel release, which is "4.19.0-10-amd64".

Please note that the outputs of these commands may vary depending on the system they are run on.

Except where otherwise noted, content on this site is licensed under a CC BY-SA 4.0 license CC BY SA