Chinaunix首页 | 论坛 | 博客
  • 博客访问: 871606
  • 博文数量: 179
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1546
  • 用 户 组: 普通用户
  • 注册时间: 2015-01-27 11:05
个人简介

MySQL工程师 QQ:1815357042

文章分类

全部博文(179)

文章存档

2015年(179)

分类: LINUX

2015-02-03 14:57:56

如何查询Linux内核信息以及发行版是很重要的,这是因为软件安装时要区分i386的32位平台和x86_64的64位平台,所以一定要掌握相关信息,
其实不只是单纯要知道操作系统版本,还有很多有意义的信息


uname  -a 命令
  1. [root@localhost ~]# uname -a
  2. Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux


不明白的话可以输入man命令

  1. [root@localhost ~]# man uname

  1. UNAME(1) User Commands UNAME(1)

  2. NAME
  3.        uname - print system information

  4. SYNOPSIS
  5.        uname [OPTION]...

  6. DESCRIPTION
  7.        Print certain system information. With no OPTION, same as -s.

  8.        -a, --all
  9.               print all information, in the following order, except omit -p and -i if unknown:

  10.        -s, --kernel-name
  11.               print the kernel name

  12.        -n, --nodename
  13.               print the network node hostname

  14.        -r, --kernel-release
  15.               print the kernel release

  16.        -v, --kernel-version
  17.               print the kernel version

  18.        -m, --machine
  19.               print the machine hardware name
有时候一页显示不完内容,可以按空格键或回车键来向下滚动


查询发行版信息,主要看当前操作系统类型版本
  1. [root@localhost ~]# cat /etc/*-release
  2. CentOS release 6.4 (Final)
  3. LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
  4. CentOS release 6.4 (Final)
  5. CentOS release 6.4 (Final)


Red Hat系列查询发行版信息使用下面命令
  1. [root@localhost ~]# cat /etc/redhat-release
  2. CentOS release 6.4 (Final)


其他方式查询发行版信息,与uname命令类型
  1. [root@localhost ~]# cat /proc/version
  2. Linux version 2.6.32-358.el6.x86_64 (mockbuild@c6b8.bsys.dev.centos.org) (gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC) ) #1 SMP Fri Feb 22 00:31:26 UTC 2013


查询操作系统是32位还是64位
查询Linux操作系统应用平台非常重要,以免在使用rpm方式安装软件时候,才发现软件版本不符合系统应用平台,大多数人都知道使用uname命令去查询,
但是uname实在太长,如何使用最简单的方法查看呢,以下示例能够识别32位或64位操作系统

在64位应用平台是uname命令查询,再使用getconf命令查询64位操作系统,进行对比是否一样
注意getconf命令是大小写敏感的
  1. [root@localhost ~]# uname -a
  2. Linux localhost.localdomain 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
  3. [root@localhost ~]# getconf LONG_BIT
  4. 64
  5. [root@localhost ~]#

32位平台同理也是执行上面两个命令


阅读(763) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~