uname – Print system information

The uname command in Linux is used to print system information such as the operating system name, kernel version, machine hardware name, and processor type. It is used to know the system information of a Linux machine.

Overview

The uname command is used to print system information on the terminal. It can be used with different options to print different information about the system. Here are some examples:

  • To print the operating system name, use: uname -o
  • To print the kernel version, use: uname -r
  • To print the machine hardware name, use: uname -m
  • To print the processor type, use: uname -p
  • To print all the system information at once, use: uname -a

Options

Here are the available options for the uname command:

Option Description
-a Prints all system information.
-m Prints the machine hardware name.
-n Prints the network node hostname.
-o Prints the operating system name.
-p Prints the processor type.
-r Prints the kernel release version.
-s Prints the kernel name.
-v Prints the kernel version.

Troubleshooting Tips

The uname command is a simple command that does not have any common issues or errors. However, if you are not getting the expected output, make sure you are using the correct option for the information you are trying to print.

Notes

  • The uname command can be used to determine the system information of a remote Linux machine by using the SSH command.
  • The uname command can be useful when troubleshooting issues related to hardware compatibility or software compatibility with the operating system.