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 Command
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 uname
command:
uname [OPTIONS]...
The options are as below:
-a, (--all)
– It will show all the available information about system.-snrvmo
will 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.
uname
The output will be the name of the kernel is “Linux”:
Linux
Generally, the uname
command is used with the -a
option to print all the information:
uname -a
Linux tecnstuff 4.15.0-101-generic #102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020 x86_64 GNU/Linux
Here,
Linux
– It’s Kernel nametecnstuff
– This is Hostname4.15.0-101-generic
is Kernel release102-Ubuntu SMP Mon May 11 10:07:26 UTC 2020
– Kernel versionx86_64
– Machine hardware nameGNU/Linux
– Operating system name
You can use the options with each other for a specific output. For instance, to determine the hostname
and kernel
name of your system, you would type:
uname -rn
tecnstuff 4.15.0-101-generic
The output will be in the same sequence as output show with -a
option. So it doesn’t matter if you issue -rn
or -nr
it will show output same in sequence.
Conclusion
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.