5 UNIX / Linux uname Command Examples

What is uname?
5 uname examples
Syntax and Options
Related Commands

What is uname?

The uname command is used to print system information like kernel version, kernel release etc

5 uname Examples

1. A basic example

By default the uname command prints just the kernel name.

For example :

$ uname
Linux

2. Get the kernel name using -s option

Through -s option too, the name of the kernel can be displayed in output.

For example :

$ uname -s
Linux

3. Get the network node host name using -n option

Name of your host as a network node can be displayed in output through -n option.

For example :

$ uname -n
himanshu-laptop

4. Get kernel release information using the -r option

For example :

$ uname -r
2.6.32-21-generic

5. Get maximum information through -a option

For example :

$ uname -a
Linux himanshu-laptop 2.6.32-21-generic #32-Ubuntu SMP Fri Apr 16 08:09:38 UTC 2010 x86_64 GNU/Linux

Syntax and Options

uname [OPTION]...
Short Option Long Option Option Description
-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 or “unknown”
-i –hardware-platform print the hardware platform or “unknown”
-o –operating-system print the operating system

Related Commands

arch