Summary

The Linuxunamecommand can display information about the system. you may use different options with theunamecommand to filter out the specific information you require. Theunamecommand can retrieve information like the system hostname, version of the kernel, and processor architecture.

What Is uname on Linux?

On Linux,uname(derived from “UNIX name”) is a simple command that you may run without anyspecial permissionto output basic information about theoperating systemand hardware platform of your Linux computer. For example, You can use theunamecommand for troubleshooting,checking system upgrades, scripting, andmonitoring purposes. You can also check the kernel release details, Linux kernel version, andhardware architecture (32-bit or 64-bit).

The basic structure for using theunamecommand is:

Here, you can use the “[OPTION]” parameter to specify the type of information you need. For example, you can use the-aoption to show all system information and the-noption for thenetwork node hostname. Theunamecommand has several options, which we will go over below.

When usingunamecommand without any option or argument, it gives you the system’s kernel name:

uname command with version option

When you use theunamecommand without any option, its output may vary depending on your Linux distribution. For example, someLinux distributionsdisplay their name or code name—some will only print “Linux”. It all depends on how developers of each distribution decide to show that information in theunameoutput.

You can check the installed version ofunamecommand by using the–versionoption with theuname:

uname command help

To learn options, you can use the–helpparameter. This command will display a help message that explains the various options and their usage with theunamecommand:

uname Command Options

you may use theunamecommand with options to display details like machine architecture, the kernel release number and version, hostname, and more. We’ll go over several in detail, but we’ve compiled below a handy reference table of all the relevant options you can use withunamecommand:

-s

–kernel-name

Displays the kernel name

-a

–all

Shows all available system information, including kernel name, version, processor type, and hardware platform

-r

–kernel-release

Displays the kernel release

-n

–nodename

Shows the hostname or system’s node name

-m

–machine

Shows the machine’s architecture type or hardware name

-v

–kernel-version

Shows the kernel version

-i

–hardware-platform

Displays the hardware platform type (Note: Not supported on every system)

-p

–processor

Shows the processor or CPU type (Note: Not supported on every system)

-o

–operating-system

Displays the operating system name

Now, you know theunamecommand options. Let’s jump to the various examples of theunamecommands with different options.

You can use the -a or –all option with theunamecommand to display all system information. It provides a thorough overview of system information.

The output contains the following details:

To print the kernel name, you can either use theunamecommand without any option or with the-soption. Both these commands will give you the same result.

You can print the current kernel version using the-voption. This option gives you specific details about the kernel version you’re using on Linux.

The output can be broken down into several components:

The-voptions give a detailed description of the installed kernel. However, you can also only print the kernel release number using the following command:

Breaking down the above output:

You can use the-noption to print the networkhostname of your Linux computer. The hostname is a computer’s unique name in a network. Your Linux operating system uses the hostname to communicate with other nodes on the network.

The Linuxhostnameandhostnamectlcommands can also give you the system network hostname.

You can use the-moption with theunamecommand to identify the machine’s hardware architecture. It can display the processor information, machine hardware name, and hardware platform information.

Here, the x86_64 represents the machine hardware name. It is a 64-bit architecture on x86 platforms. This is a common output for most Linux systems with Intel or AMD processors. If you run the commanduname -mand it returns the output i686, it means that your computer is using a 32-bit kernel.

The-m,-p, and-ioptions of theunamecommand often display identical output. They all provide information related to hardware architecture.

The-ooption with theunameshows the name of the operating system. You can either useuname -ooruname -operating systemoption.

you’re able to see GNU/Linux as the output. It means the operating system is a Linux variant thatuses the GNU system as its foundation. This is the most common output for popular Linux distributions.

Using Command Options Together

you’re able to also use multiple options together with theunamecommand. You can create any combination of options to get the information you are looking for. For example, you can use theuname -r -vcommand to print both the kernel release date and the kernel version.

You can also write the options without spaces, such asuname -rv. This will show you the same output asuname -r -v.

Here is another example, you may use theuname -srmcommand to print the kernel name, the machine architecture, and the kernel release date. This is useful if you want to know what kind of hardware and software your system is running on.

In general, you can use the-aoption to print all the system information in one line—as shown in the previous section. But you can also combine multiple options together to get the same output as you get with-aoption. Use theuname -snrvmocommand to get the same output as theuname -acommand return.

Know Your Linux System Information

You are not limited to theunamecommand for getting system information. You can also use othersmultiple Linux commandsto get correct information about your Linux system. These Linux commands help you to manage your system more effectively.

Like theunamecommand, you can use thelshwcommand togather information about your hardware componentssuch as CPU, disks, memory, and USB controllers. Managing Linux system storage is important for making sure don’t run short on space. For that, you can use commands likedf,fdisk, ormount. These commands give you the details of storage on your system. All these commands can help you to gather specific information related to your Linux system.