Categories: Linux

Uname Command in Linux

Uname command in Linux will be covered in this tutorial. uname is a command-line utility that prints basic information about the operating system name and system hardware.

uname Command

The uname tool is most commonly used to determine the processor architecture, the system hostname and the version of the kernel running on the system.

The syntax of the uname command takes the following form:

uname [OPTIONS]...

The options are as follows:

  • -s, (--kernel-name) – Prints the kernel name.
  • -n, (--nodename) – Prints the system’s node name (hostname). This is the name the system uses when communicating over the network. When used with the -n option, uname produces the same output as the hostname command.
  • -r, (--kernel-release) – Prints the kernel release.
  • -v, (--kernel-version) – Prints the kernel version.
  • -m, (--machine) – Prints the name of the machine’s hardware name.
  • -p, (--processor) – Prints the architecture of the processor.
  • -i, (--hardware-platform) – Prints the hardware platform.
  • -o, (--operating-system) – Print the name of the operating system. On Linux systems that is “GNU/Linux”
  • -a, (--all) – When the -a option is used, uname behaves the same as if the -snrvmo options have been given.

When invoked without any options, uname prints the kernel name, as if the -s option had been specified:

$ uname

As you already know, the name of the kernel is “Linux”:

Output

Linux 

You don’t have to remember all the command-line options. Usually, the uname command is used with the -a option to print all available information:

$ uname -a
Output

Linux dev.linuxize.com 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u1 (2019-10-26) x86_64 GNU/Linux 

The output includes the following information:

  • Linux – Kernel name.
  • dev.linuxize.com – Hostname.
  • 4.19.0-6-amd64 Kernel release.
  • #1 SMP Debian 4.19.67-2+deb10u1 (2019-10-26) – Kernel version.
  • x86_64 – Machine hardware name.
  • GNU/Linux – Operating system name.

The options can be combined with each other to produce the desired output. For example, to find out what version of the Linux kernel is running on your system, you would type the following command:

$ uname -srm
Output

Linux 4.19.0-6-amd64 x86_64 

When multiple options are used the information contained in the output is in the same order as provided by the -a option. The position of the given options doesn’t matter. Both uname -msr and uname -srm produces the same output.

Uname Command in Linux: Conclusion

The uname command is used to print basic system information. It is usually invoked with the -a option to display all available information.

Arslan ud Din Shafiq

Alibaba Cloud MVP, Alibaba Cloud Technical Author, Dzone MVB, Software Engineer, Software Developer, Software Designer, Web Engineer, Web Developer, Web Designer, Database Designer, Database Developer, Cloud Computing Specialist, Linux Expert, Servers, 3D Modeling, Blogger, Facebook Map Editor, Google Map Editor

Recent Posts

How To Set Up Secure Nginx Server Blocks on Ubuntu 22.04

NGINX Server Nginx, a popular open-source web server, excels at handling high traffic websites efficiently.… Read More

1 week ago

The Web Server Showdown: Nginx vs. Apache, LiteSpeed, Caddy, and Beyond

In the realm of web hosting, choosing the right web server is paramount. It acts… Read More

1 week ago

Linear guidance systems

Are indispensable for ensuring smooth, precise linear motion in many industrial applications. Whether in robotics,… Read More

2 months ago

Cyber Attack Statistics – Identifying Vulnerabilities and Strengthening Defenses

Cyber attacks are becoming more frequent, complex, and damaging. They can disrupt critical operations and… Read More

3 months ago

Empowering Cybersecurity in 2024 with XDR for Comprehensive Threat Detection and Response

With the rise of new threats and the increasing complexity of IT environments, organizations need… Read More

3 months ago

Facade Design Pattern: Simplifying Complex Systems

1. Introduction In software design, managing complex systems can be challenging. The Facade Design Pattern… Read More

5 months ago