uname

Print system information.

Summary

uname [OPTION]...

The main purpose

Options

-a, --all Print all information in order, if -p and -i information is unknown, then omit.
-s, --kernel-name Print kernel name.
-n, --nodename Print network node host name.
-r, --kernel-release Print kernel release.
-v, --kernel-version Print kernel version.
-m, --machine Print machine name.
-p, --processor Print processor name.
-i, --hardware-platform Print the hardware platform name.
-o, --operating-system Print operating system name.
--help Display help information and exit.
--version Display version information and exit.

return value

Returning 0 indicates success, returning a non-zero value indicates failure.

example

# When using the uname command alone, it is equivalent to uname -s
[root@localhost ~]# uname
Linux
# View all information
[root@localhost ~]# uname -a
Linux localhost 2.6.18-348.6.1.el5 #1 SMP Tue May 21 15:34:22 EDT 2013 i686 i686 i386 GNU/Linux
# List information separately
[root@localhost ~]# uname -m
i686

[root@localhost ~]# uname -n
localhost

[root@localhost ~]# uname -r
2.6.18-4-686

[root@localhost ~]# uname -s
Linux

[root@localhost ~]# uname -v
#1 SMP Tue May 21 15:34:22 EDT 2013

[root@localhost ~]# uname -p
i686

[root@localhost ~]# uname -i
i386

[root@localhost ~]# uname -o
GNU/Linux

Notice