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 –
uname [options]
Options
The options that can be used with uname command are –
Options | Description |
---|---|
-a , --all | Print all the information displayed by following options |
-s , --kernel-name | Display the kernel name |
-n , --nodename | Print the network hostname |
-r , --kernel-release | It will print the kernel release |
-v , --kernel-version | Print the kernel version |
-m , --machine | Print the machine hardware name |
-p , --processor | It will print the processor type |
-i , --hardware-platform | Print the hardware platform |
-o , --operating-system | Print the operating system |
--help | display the option with the summary |
--version | 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 –
uname -p
or
uname --processor
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 –
uname -n
or
uname --nodename
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 –
uname -v
or
uname --kernel-version
Conclusion
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.