How to Use uname Command on Linux

Welcome to our today’s guide on how to use uname command on Linux. As per its man page, uname command is used to print certain system information. When you invoke uname command without any option it prints the kernel name.

How to Use uname Command on Linux

Syntax;

uname [OPTION]…

Display System Information using uname command

Using -a or --all option, uname will print all system information;

uname -a
Linux thehero 5.4.0-56-generic #62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Display System Hostname using uname command

Using -n or --nodename option, uname will print the network node hostname;

uname -n
thehero

Display system Kernel Name using uname command

Using -s or --kernel-name option, uname print the kernel name;

uname -s
Linux

Display Kernel Version using uname command

Option -v or --kernel-version, uname will print the kernel version;

uname -v
#62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020

Display Kernel Release using uname command

uname command print the kernel release version using -r or --kernel-release option.

uname -r
5.4.0-56-generic

Display Machine Hardware Name using uname command

uname command print the machine hardware name using -m or --machine option.

uname -m
x86_64

Display Hardware Platform using uname command

uname command print the hardware platform using -i or --hardware-platform option.

uname --hardware-platform
x86_64

Display Processor Type using uname command

Using -p or --processor option, uname command will print the processor type.

uname -p
x86_64

Display Operating System using uname command

Using -o or --operating-system option, uname will print the operating system.

uname -o
GNU/Linux

Display Help using uname command

Using --help option, uname will display this help and exit.

uname --help
Usage: uname [OPTION]...
Print certain system information.  With no OPTION, same as -s.

  -a, --all                print all information, in the following order,
                             except omit -p and -i if unknown:
  -s, --kernel-name        print the kernel name
  -n, --nodename           print the network node hostname
  -r, --kernel-release     print the kernel release
  -v, --kernel-version     print the kernel version
  -m, --machine            print the machine hardware name
  -p, --processor          print the processor type (non-portable)
  -i, --hardware-platform  print the hardware platform (non-portable)
  -o, --operating-system   print the operating system
      --help     display this help and exit
      --version  output version information and exit

GNU coreutils online help: <https://www.gnu.org/software/coreutils/>
Full documentation at: <https://www.gnu.org/software/coreutils/uname>
or available locally via: info '(coreutils) uname invocation'

Display Version Information using uname command

Using --version option, uname command will output version information and exit.

uname --version
uname (GNU coreutils) 8.30
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

Conclusion

This mark the end of our guide on how to use uname command on Linux. We hope this guide was helpful. Cheers!

Other Guides;

How to Install Software Packages on Linux system

How to Use fdisk Partitioning Tool on Linux

How To List Running Services on Linux

Encrypt and Decrypt Files with Vim Editor

Leave a Comment