Uname (short for unix name) 是一个 Unix 与类 Unix 系统中用于查看系统版本信息的命令.

Print the kernel name:

uname
# or 
uname -s

Example output:

# on Ubuntu:
Linux
# on Mac:
Darwin

Print all informations:

uname -a

Example output:

# on Ubuntu:
Linux kvmla 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
# on Mac:
Darwin office 16.7.0 Darwin Kernel Version 16.7.0: Thu Jun 15 17:36:27 PDT 2017; root:xnu-3789.70.16~2/RELEASE_X86_64 x86_64

Print the kernel release:

uname -r

Print the kernel version:

uname -v

And more: uname(1) print system info - Linux Die.

References

uname - Wikipedia

uname(1) print system info - Linux Die