Uname is a Linux command-line utility that displays basic system information. It prints operating system details and machine hardware platform information of your Linux computer.
In this tutorial, we will learn about the uname command and its options to display various system information.
- A computer running Linux operating system.
- Basic understanding of the Linux command line interface.
- Passion to learn new Linux commands.
Uname stands for UNIX name. It is a utility to check the system information of your Linux computer. The uname command is commonly used to checks OS details, OS architecture (32 bit or 64 bit), Linux Kernel version, and Kernel release.
When used without any options, the uname command displays the operating system name. However, you can use various options to display specific information, such as
-a for all information and
-n for network node hostname.
To run uname command, users don't require any special privileges. This is the basic syntax of the uname command:
The uname output:
Kernel name - Linux.
Host node name - machine01.
Kernel release - 5.14.14-300.fc35.x86_64.
Kernel version and build time - #1 SMP Wed Oct 20 16:14:50 UTC 2021.
x86_64 x86_64 x86_64 - Processor type, hardware platform and architecture of processor.
GNU/Linux - Operating system name.
Uname Command Options
The uname command provides various options to filter out system information. The following table shows some of the most commonly used options of the uname command:
|Display all information about the operating system, Kernel version, and hardware|
|Display only the network node hostname|
|Display the Kernel name|
|Display the Kernel release version|
|Display the Kernel version with date|
|Display the hardware platform name of the system|
|Display the processor type|
|Display the operating system name|
Uname Command Examples
The most common example of the uname command is to use it without any options:
This example shows only the operating system name, without any version information and distribution name. This is not very helpful when you need to find specific version information.
The following examples show you how to display certain information about your Linux system using the uname command.
uname -a command can be used to display all system information such as the OS name, version, and Kernel release.
This example output shows that we are running a Linux operating system and the hostname is
linux. The Kernel version is
188.8.131.52-generic and this is an
Ubuntu Linux distribution. It also shows the time when the Kernel was compiled and Kernel architecture that is
The information displayed by the
uname -a command is unorganized and could be difficult to read.
If you need specific information about your system Kernel, such as the release number of the Kernel, use
uname -r command:
However, if you need to check when this Kernel was compiled, then use:
You can combine uname options to display better information. For example, to display release number and compile date, type:
uname -r -v
The hostname is used by the Linux operating system to communicate with other nodes in a network. The
uname -n command can be used to display the hostname of your Linux computer.
The same information can be displayed using the hostname and hostnamectl commands.
The uname command can also be used to display machine hardware name, processor information, and hardware platform information. Use uname -m to print the machine hardware name.
The output of –m, -p, and –i options are often the same:
uname -o print the operating system name.
In this tutorial, we learned about the uname command, and its various options that can be used to display a variety of system information. This command works in almost all Linux distributions, such as Ubuntu, Debian, Red Hat, and Fedora.
If you are unable to remember any of the uname options, use
--help option to display the help page or browse to man uname command.