How to View System Information in Ubuntu Linux Terminal Using the uname Command

When working in a Linux environment, especially when managing remote servers or troubleshooting software compatibility, you frequently need to know exactly what system you are running on. You might need to know the specific kernel version to install a driver, the machine architecture to download the correct software package, or the network hostname. The uname (Unix name) command is the standard, built-in tool for printing basic system information directly to your terminal.

The Basic Command

If you simply type the command without any flags:

uname

The terminal will likely just return Linux. This simply confirms the kernel name, which isn’t very helpful on its own. To extract useful data, you must use specific flags.

Printing All System Information (uname -a)

The most common and useful way to run this command is using the “all” flag. This prints every piece of system information available to the tool in a single, comprehensive line.

uname -a

The output will look something like this:
Linux ubuntu-server 5.15.0-76-generic #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

This string contains a wealth of information, broken down into the following components (which you can also query individually):

Querying Specific Information

If you only need one specific piece of data (for example, if you are writing a script that only needs to know the kernel version), you can use individual flags instead of printing everything.

  • Kernel Name (-s): Prints the name of the operating system kernel.
    uname -s (Returns: Linux)
  • Network Node Hostname (-n): Prints the hostname of your machine as it appears on the network.
    uname -n (Returns: ubuntu-server)
  • Kernel Release (-r): This is highly useful when installing drivers or kernel modules. It prints the exact version number of the active Linux kernel.
    uname -r (Returns: 5.15.0-76-generic)
  • Kernel Version (-v): Prints the date and time the kernel was compiled, and the OS version it was built for.
    uname -v (Returns: #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023)
  • Machine Hardware Architecture (-m): Critical for knowing if you need to download a 64-bit, 32-bit, or ARM software package.
    uname -m (Returns: x86_64, indicating a 64-bit architecture. An ARM processor might return aarch64).
  • Operating System (-o): Prints the name of the operating system.
    uname -o (Returns: GNU/Linux)

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.