Search notes:

Shell command: uname

uname prints information about the system.
If uname is executed without option, it prints the kernel name (that is the same output as uname -s does).

Operating system

uname -o prints the name of the operation system, for example
Compare with the (Bash) variable $OSTYPE and /proc/sys/kernel/ostype.

Host name

uname -n prints the host name. Compare with cat /etc/hostname.

Kernel name and release

uname -s prints the name of the kernel, for example
uname -r prints the kernel release, for example 4.12.8-2-ARCH or 6.1.38-gentoo-x86_64 (see also the Kernel release cycle).
The value of uname -r is used to determine the actual subdirectory under /lib/modules (i. e. /lib/modules/$(uname -r)).

CPU and hardware

uname -p prints the processor type, for example x86_64.
uname -m prints the machine hardware name (architecture), for example x86_64. This is the same output that also arch prints.
The equivalent on Solaris is: isainfo -b.
uname -i prints the hardware platform, for example x86_64.
uname -p and uname -m should get the same output. uname -i is smaller or equal to the other two.
Use lscpu to display information about the CPU architecture.

All information

All information can be printed at once with uname -a. It prints a string like
Linux L1 4.4.0-24-generic #43-Ubuntu SMP Wed Jun 8 19:27:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

See also

/etc/os-release
/proc/version
Shell commands
The Python standard-lib module os has a method named uname()

Index