Uname command is used to display basic information about the operating system and hardware. In addition, you can use options with
uname to print kernel details and system architecture.
uname is the short name for “UNIX name”. This command works on all Linux and Unix like operating systems. Mostly, it is used to know hostname, processor architecture, and the version of the kernel running on the system.
Following is the basic syntax of the
The options are as below:
-a, (--all)– It will show all the available information about system.
-snrvmowill produce the same output.
-s, (--kernel-name)– Prints the kernel name.
-n, (--nodename)– Display hostname
-r, (--kernel-release)– Prints the kernel release.
-v, (--kernel-version)– Display the kernel version.
-i, (--hardware-platform)– To show the hardware platform.
-m, (--machine)– Shows the name of the machine’s hardware name.
-p, (--processor)– Prints the architecture of the processor.
-o, (--operating-system)– Print the name of the operating system. On Linux systems that is “GNU/Linux”
When you run
uname command without any
options it just prints the core operating system name.
The output will be the name of the kernel is “Linux”:
uname command is used with the
-a option to print all the information:
Linux tecnstuff 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 GNU/Linux
Linux– It’s Kernel name
tecnstuff– This is Hostname
4.15.0-101-genericis Kernel release
102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020– Kernel version
x86_64– Machine hardware name
GNU/Linux– Operating system name
You can use the options with each other for a specific output. For instance, to determine the
kernel name of your system, you would type:
The output will be in the same sequence as output show with
-a option. So it doesn’t matter if you issue
-nr it will show output same in sequence.
In this tutorial we learned how to use uname command to get kernel, system, hardware and processor information, etc. Generally, it is used with
-a option to display all available information.
I hope you enjoyed reading and please leave your suggestion in the below comment section.
If you have any questions or suggestion, please leave a comment below.