欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  科技

CentOS系统版本的查看方法

程序员文章站 2022-05-18 11:03:08
CentOS系统版本的查看方法 查看操作系统版本 1 2 查看Linux内核版本 1 2 查看系统位数 1 32位的系统中int类型和long类型一般都是4字节,64位的系统中int类型还是4字节的,但是long已变成了8字节Linux系统中可用”getconf WORD_BIT和getconf L ......

centos系统版本的查看方法

查看操作系统版本

1

1 [root@aliyun ~]# lsb_release -a
2 lsb version:    :core-4.1-amd64:core-4.1-noarch
3 distributor id:    centos
4 description:    centos linux release 7.6.1810 (core) 
5 release:    7.6.1810
6 codename:    core

2

1 [root@aliyun ~]# cat /etc/redhat-release
2 centos linux release 7.6.1810 (core) 

查看linux内核版本 

1

1 [root@aliyun ~]# uname -a
2 linux aliyun 3.10.0-957.1.3.el7.x86_64 #1 smp thu nov 29 14:49:43 utc 2018 x86_64 x86_64 x86_64 gnu/linux

2

1 [root@aliyun ~]# cat /proc/version
2 linux version 3.10.0-957.1.3.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (red hat 4.8.5-36) (gcc) ) #1 smp thu nov 29 14:49:43 utc 2018

查看系统位数

1

1 [root@aliyun ~]# getconf long_bit
2 64

32位的系统中int类型和long类型一般都是4字节,64位的系统中int类型还是4字节的,但是long已变成了8字节linux系统中可用”getconf word_bit和getconf long_bit获得

word和long的位数。

64位系统中应该分别得到word位数32和long位数64

因此该系统为64位的系统

2

1 [root@aliyun ~]# uname -a
2 linux aliyun 3.10.0-957.1.3.el7.x86_64 #1 smp thu nov 29 14:49:43 utc 2018 x86_64 x86_64 x86_64 gnu/linux
x86_64      系统64位 
i386 i686  系统32位