Skip to main content
What is the uname command with an example in Linux
Rapyd Team avatar
Written by Rapyd Team
Updated over a year ago

The uname command in Linux serves as an invaluable resource for obtaining crucial system details, such as the operating system, kernel version, hostname, and more. Particularly useful for system administrators and savvy users, the uname command offers an easy way to diagnose and glean details about a machine or its operating system.

Introduction to uname

The term "uname" is short for "UNIX name." This command aims to offer essential details about your system, including but not limited to the machine type, operating system, kernel version, and hostname.

Basic Syntax of uname

The basic command structure for uname is straightforward:

uname [options]
  • [options]: These are optional flags that dictate which specific system details you want to display.

Common Usage Examples

Display the Operating System Name:

uname -o

Display the Kernel Name:

uname -s

Display the Kernel Release:

uname -r

Display the Kernel Version:

uname -v

Display the Machine Hardware Architecture:

uname -m

Display the Hostname of the Machine:

uname -n

Display All Information Simultaneously:

Using the -a flag shows all the information at once.

uname -a

Additional Options and Tips

Print the Processor Type:

Though not universally supported on all systems, you can try:

uname -p

Get Help on uname Command:

For a quick overview or aid concerning the command:

uname --help

Check Version of uname:

To ascertain the version of the uname command you’re using:

uname --version

Conclusion

The uname command serves as a foundational tool for rapidly gaining insight into system specifics, especially valuable for troubleshooting, system configuration validation, or scripting that necessitates a deep understanding of the system's attributes. Given its simplicity and low overhead, the uname command is indispensable for anyone who finds themselves regularly interacting with UNIX or Linux systems.

Did this answer your question?