Uname is a command used in Linux/Unix to print the system information. Most commonly used to determine the processor architecture, hostname, kernel information, etc. The GNU version of uname is included in “sh-utils” or “coreutils” packages. Ahead in this article, we will discuss uname command and its usage.
Syntax of uname command
Following is the syntax of uname command –
The options that can be used with uname command are –
||Print all the information displayed by following options|
||Display the kernel name|
||Print the network hostname|
||It will print the kernel release|
||Print the kernel version|
||Print the machine hardware name|
||It will print the processor type|
||Print the hardware platform|
||Print the operating system|
||display the option with the summary|
||It will display the current version of uname(Coreutils)|
Now let see some usage of uname command.
How to display the processor architecture of a system?
To display the processor architecture or processor type you need to use -p option with uname command. Use the following command in your terminal –
Here x86_64 is the processor architecture of your system.
How to display the hostname of a system?
To display the hostname of a system you need to use the -n option with the uname command. Now use the following command in your terminal to display the hostname –
How to print the kernel version of a Linux or Unix machine?
To display the kernel version used in a Linux/Unix machine use the -v or –kernel-version with uname command. Now Use the following command in the terminal –
By reading this article you learn to find various information about a system with uname command. Now if you have any thoughts you can share it with us in the comments below.