The uname (which stands for βUnix Nameβ) is a commonly used Linux command-line utility to print basic information about the operating system name and system hardware.
The output with the β-aβ flag will give you a summary of your system architecture, kernel name, kernel release, kernel version, hardware platform, and many more.
In this quick tutorial, you will learn how to use the uname command and its options to get your desired system information (with practical examples).
Tutorial Details
| Description | Display the Operating System and Hardware Information |
| Difficulty Level | Low |
| Root or Sudo Privileges | No |
| OS Compatibility | Ubuntu, Manjaro, Fedora, etc. |
| Prerequisites | uname |
| Internet Required | No |
Usage of the Uname Command
The uname command takes one argument as an option (optional).
$ uname [OPTION]Note that most of the options offered by this tool are self explanatory and are mentioned in the following table.
| Options | Description |
|---|---|
-s | Kernel Name. |
-r | Kernel Release. |
-v | Kernel Version. |
-n | Network Node Name (Hostname). |
-m | Machine Architecture. |
-p | Processor Architecture. |
-i | Hardware Platform (OS Architecture). |
-o | Operating System. |
-a | Show all the Information that Requires the β-snrvmoβ Options. |
When you invoke this command without specifying any options, it will print the kernel name, which is equal to the β-sβ flag.
$ unameOutput:

Now, letβs take a look at a few options offered by this command-line tool.
Display All Available Information Into a Single Output
Most of the time, you will invoke this command in conjunction with the β-aβ flag to combine all information into a single output.
$ uname -aOutput:

The above output contains all the necessary information in the following order:
Linuxβ Kernel name.linuxβ Hostname.5.15.0-53-genericβ Kernel release.59-Ubuntu SMP Mon Oct 17 18:53:30 UTC 2022β Kernel Version.x86_64β Machine architecture.x86_64β Processor architecture.x86_64β Operating system architecture.GNU/Linuxβ Operating system name.
As you can see, all the information that requires β-snrvmoβ flags is printed in the same output using the single option.
Note that the few items that are identical, like the machine, processor, and the operating systemβs architecture, are the same in my system but might be different in yours.
Aside from that, you can get all of the information in this output using the desktop manager, but command-line programs have their own benefits (speed is emphasized).
Display the Kernel Information
Unlike the previous example, you can print only the information related to your kernel, like its name (with the β-sβ flag), release (with the β-rβ flag), and version (with the β-vβ flag).
$ uname -srvOutput:

Note that the position of the given options doesnβt matter; it can be βuname -rvsβ or βuname -vsrβ produce the same output.
Display the Operating System Information
You can print operating system related information, like its hostname (with the β-nβ flag), OS architecture (with the β-iβ flag), and operating system (with the β-oβ flag).
$ uname -nioOutput:

Again, the position of the given options doesnβt matter, as all combinations will produce the same output.
Display the Hardware Information
The hardware information, like machine architecture (with the β-mβ flag) and processor architecture (with the β-pβ flag), will return the output in βx86_64β for 64-bit and βx86_32β for 32-bit.
$ uname -mpOutput:

As you can see from the above picture, both hardware architectures are 64-bit, but it might be different in your case; if you are still using a 32-bit system, then let me know in the comment section.
Wrap Up
Letβs make a few things clear: system architecture is fully dependent upon your system hardware, including the operating system and the kernel.
As for the hostname, it will be the one specified by you; in my case, it was βlinuxβ, but in your case, it will be the one specified by you, and this information is pulled from the β/etc/hostnameβ file.
In addition to that, if you run this command in a virtual machine, the information for processor architecture and OS architecture will possibly return βunknownβ in the output.
So, thatβs all for it; if you have any questions or queries related to this article, then feel free to ask them in the comment section.
Till then, peace!





Join The Conversation
Users are always welcome to leave comments about the articles, whether they are questions, comments, constructive criticism, old information, or notices of typos. Please keep in mind that all comments are moderated according to our comment policy.