How To Display The System Information Using uname Command In Linux/Unix?

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 –

OptionsDescription
-a, --allPrint all the information displayed by following options
-s, --kernel-nameDisplay the kernel name
-n, --nodenamePrint the network hostname
-r, --kernel-releaseIt will print the kernel release
-v, --kernel-versionPrint the kernel version
-m, --machinePrint the machine hardware name
-p, --processorIt will print the processor type
-i, --hardware-platformPrint the hardware platform
-o, --operating-systemPrint the operating system
--helpdisplay the option with the summary
--versionIt 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.

Leave a Comment