摘要:本文主要向大家介绍了Linux运维知识之如何查看CentOS 7.x版本信息,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
本文主要向大家介绍了Linux运维知识之如何查看CentOS 7.x版本信息,通过具体的内容向大家展现,希望对大家学习Linux运维知识有所帮助。
前言
由于CentOS 7 和之前的6以下的版本查看系统版本及查看机器位数x86-64的方法不一样,部分命令差异也比较大,现就如在CentOS 7下查询版本信息
首先要清楚什么样标识是32位的,什么样的是64位的。
PC server X86 系列
I386--I686 都是32位
x86_64 是 64位
查看位数命令
命令实在是不要太多,为了防止选择性障碍,一致选择第一种方式,后面的仅作为补充。
方法1:
[root@linuxidc ~]# uname -a
Linux linuxidc 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
方法2:显示系统程序信息
[root@linuxidc ~]# file /bin/ls
/bin/ls:
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked
(uses shared libs), for GNU/Linux 2.6.32,
BuildID[sha1]=aa7ff68f13de25936a098016243ce57c3c982e06, stripped
方法3:
[root@linuxidc ~]# cat /proc/version
Linux
version 3.10.0-327.18.2.el7.x86_64 (builder@kbuilder.dev.centos.org)
(gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu May 12
11:03:55 UTC 2016
方法4:
(32位的系统中int类型和long类型一般都是4字节,64位的系统中int类型还是4字节的,但是long已变成了8字节inux系统中可用"getconf WORD_BIT"和
"getconf LONG_BIT"获得word和long的位数。64位系统中应该分别得到32和64。)
[root@linuxidc ~]# getconf LONG_BIT
64
查看系统版本
方法1:
[root@linuxidc ~]# lsb_release -a
LSB
Version:
:core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.2.1511 (Core)
Release: 7.2.1511
Codename: Core
方法2:
[root@linuxidc ~]# cat /etc/os-release
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel Fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
RedHat_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"
方法3(主要是查看centos具体版本信息):
[root@linuxidc ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
方法4:
[root@linuxidc ~]# rpm -q centos-release
centos-release-7-2.1511.el7.centos.2.10.x86_64
查看内核版本
方法1:
[root@linuxidc ~]# cat /proc/version
Linux
version 3.10.0-327.18.2.el7.x86_64 (builder@kbuilder.dev.centos.org)
(gcc version 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC) ) #1 SMP Thu May 12
11:03:55 UTC 2016
方法2:
[root@linuxidc ~]# uname -a
Linux linuxidc 3.10.0-327.18.2.el7.x86_64 #1 SMP Thu May 12 11:03:55 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注系统运维Linux频道!
您输入的评论内容中包含违禁敏感词
我知道了
请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式IT培训就业服务领导者 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号