The “uname” command in Linux is used to display system information about the operating system. It provides details such as the system’s kernel name, network node hostname, kernel release, version, machine hardware architecture, and more.
Here is the basic syntax of the “uname” command:
uname [options]
Here’s a practical example of how to use the “uname” command:
- Display the system’s kernel name:
uname -s
The “-s” option is used to specifically display the system’s kernel name.
Example:
$ uname -s
Linux
In this example, the “uname” command with the “-s” option displays the system’s kernel name, which is “Linux” in this case.
- Display the system’s kernel release:
uname -r
The “-r” option is used to specifically display the system’s kernel release.
Example:
$ uname -r
5.10.0-1-amd64
In this example, the “uname” command with the “-r” option displays the system’s kernel release, which is “5.10.0-1-amd64” in this case.
- Display the system’s machine hardware architecture:
uname -m
The “-m” option is used to specifically display the system’s machine hardware architecture.
Example:
$ uname -m
x86_64
In this example, the “uname” command with the “-m” option displays the system’s machine hardware architecture, which is “x86_64” in this case.
The “uname” command provides a quick way to retrieve information about the operating system and the system’s hardware. It is often used in shell scripts or command-line operations to determine specific system properties and adapt behavior accordingly.