linux uname命令


uname命令查看系统与内核相关信息,默认只打印内核的名字。如果想要查看所有的系统信息,可以加上-a选项。

[root@initroot ~]# uname [-asrmpi]
选项与参数:
-a :所有系统相关的信息,包括下面的数据都会被列出来;
-s :系统内核名称;
-r :内核的版本;
-m :系统的cpu硬件名称,例如i686或x86_64等;
-p :CPU的类型,与-m类似,只是显示的是CPU的类型!
-i :cpu硬件的平台
输出系统的基本信息:
            [root@initroot ~]# uname -a
            Linux www.initroot.com 4.15.0-65-generic #74-Ubuntu SMP Tue Sep 17 17:06:04 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
            
uname可以列出当前系统的内核版本、主要硬件平台以及CPU类型等信息。
uname打印的信息来自/proc/version文件。
可以看出Linux主机使用的内核名称为Linux,主机名为www.initroot.com,内核的版本为4.15.0-65-generic,该内核版本建立的日期为2019-9-17, 可运行的硬件平台为x86_64以上等级硬件平台。

Usage:
uname [OPTION]...
Print certain system information. With no OPTION, same as -s.
-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 (non-portable)
-i, --hardware-platform print the hardware platform (non-portable)
-o, --operating-system print the operating system
--help display this help and exit
--version output version information and exit
GNU coreutils online help: http://www.gnu.org/software/coreutils Full documentation at:
http://www.gnu.org/software/coreutils/uname or available locally via:
info '(coreutils) uname invocation'

本文由initroot编辑整理,转载请注明www.initroot.com

100次点赞 100次阅读