uname Command in Linux With Examples

Posted in

uname Command in Linux With Examples

Vinay Khatri
Last updated on June 12, 2022

    Introduction

    In this article, we will discuss the uname command which is a frequently used and easy-to-use command to get system-related information. We will see the command with various options to get different information related to your machine.

    What is “uname” command

    The uname command is used to get the information related to the Operating System and the hardware. The syntax of the command is:

    $ uname [option]

    Examples of using “uname” command

    System Information

    The -a option is used to get all the information related to the system. The output is printed in the following order: Kernel name, network node hostname, kernel release date, kernel version, machine hardware name, hardware platform, operating system.

    $ uname -a

    Kernel name

    This is done using -s option

    $ uname -s

    Hostname

    We can print the hostname of the node using -n option.

    $ uname -n

    Kernel Release Date

    -r option prints the release date of the kernel

    $ uname -r

    Kernel-Version

    -v prints the version of the current kernel

    $ uname -v

    Operating System name

    The -o option prints the name of the Operating System

    $ uname -o

    Hardware name

    To get the hardware name of the machine, use -m option

    $ uname -m

    Type of processor

    To get the type of processor, use the -p option

    $ uname -p

    Hardware Platform

    To get a hardware platform, use -i option

    $ uname -i

    Combining options

    To combine multiple options, use the below syntax

    $ uname -srm

    Conclusion

    In this article, we went through the definition and various options of the uname command. You must have realized that uname is an easy-to-use and frequently used command for Linux users.

    People are also reading:

    Leave a Comment on this Post

    0 Comments