linux查看系统信息

linux系统中有时会遇到查看系统内核版本,主机名称,cpu架构等的相关操做。 node

可用uname实现查看! linux


uname具体操做实例以下: shell

uname -a 

打印全部信息,信息格式为: 架构

内核名称   主机名   内核版本   内核发布时间   cpu硬件名  cpu类型    硬件平台   操做系统类型 this

例如,在个人主机上运行以下: spa

# uname -a Linux bb-moonshot-cc-06.bb01.baidu.com 2.6.32_1-14-0-0 #1 SMP Mon Mar 31 10:42:09 CST 2014 x86_64 x86_64 x86_64 GNU/Linux 

表示:内核为 : linux 操作系统

         主机名为: bb-moonshot-cc-06.bb01.baidu.com code

         发布版本为:  2.6.32_1-14-0-0 orm

         发布时间为:  #1 SMP Mon Mar 31 10:42:09 CST 2014 文档

         cpu硬件名: x86_64

         cpu类型:   x86_64

         硬件平台:  x86_64

        操做系统:  GNU/Linux

针对不一样的信息,可用不一样的参数查看(具体有哪些参数, 可用 uname  --help列出)

运行实例以下:

# uname -s Linux 

内核为linux内核


# uname -n bb-moonshot-cc-06.bb01.baidu.com 

列出主机名为:bb-moonshot-cc-06.bb01.baidu.com


# uname -r 2.6.32_1-14-0-0 

列出内核版本为: 2.6.32_1-14-0-0


# uname -v #1 SMP Mon Mar 31 10:42:09 CST 2014

列出version为: #1 SMP Mon Mar 31 10:42:09 CST 2014


#uname -m x86_64 

列出硬件名为: x86_64


# uname -p x86_64 

列出cpu处理器架构为: x86_64


# uname -i x86_64 

列出硬件平台为: x86_64


# uname -o GNU/Linux 

列出操做系统为: GNU/linux


# uname --help Usage: uname [OPTION]... Print certain system information.  With no OPTION, same as -s.  -a, --all                print all information, in the following order:  -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  -i, --hardware-platform  print the hardware platform  -o, --operating-system   print the operating system      --help     display this help and exit      --version  output version information and exit 

列出uname的帮助文档

相关文章
相关标签/搜索