CentOS是哪个版本 CentOS版本信息查看技巧




CentOS是哪个版本 CentOS版本信息查看技巧

2022-07-20 21:07:58 网络知识 官方管理员

  CentOS是Linux发行版之一,已经发布多个版本,那么你知道你使用的CentOS是哪个版本的吗?下面小编就给大家介绍下查看CentOS版本信息的方法,一起来学习下吧。

CentOS,版本信息

有以下命令可以查看:

#lsb_release-a
LSBVersion::core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
DistributorID:CentOS
Description:CentOSrelease5.4(Final)
Release:5.4
Codename:Final


这个命令适用于有的linux,包括Redhat、SuSE、Debian、Centos等发行版。

root@MyMail~#uname
Linux
root@MyMail~#uname-r
2.6.18-164.el5
[root@localhost~]#uname-a
Linuxlocalhost.localdomain2.6.18-194.el5#1SMPFriApr214:58:35EDT2010i686i686i386GNU/Linux


以下二种方法适用于RedHat,CentOS

root@MyMail~#cat/etc/redhat-release
CentOSrelease5.4(Final)

登录到linux执行rpm-qredhat-release

#rpm-qredhat-release
或CentOS

root@MyMail~#rpm-qcentos-release
centos-release-5-4.el5.centos.1


当前centos版本与redhat对应的版本的命令
#cat/proc/version
Linuxversion2.6.9-78.ELsmp(mockbuild@builder16.centos.org)(gccversion3.4.620060404(RedHat3.4.6-10))#1SMPFriJul2500:04:28EDT2008

  方法:

  1)[root@localhost~]#cat/proc/version

  Linuxversion2.6.18-194.el5(mockbuild@builder10.centos.org)(gccversion4.1.220080704(RedHat4.1.2-48))#1SMPFriApr214:58:14EDT2010

  2)

  [root@localhost~]#uname-a

  Linuxlocalhost.localdomain2.6.18-194.el5#1SMPFriApr214:58:14EDT2010x86_64x86_64x86_64GNU/Linux

  3)

  [root@localhost~]#uname-r

  2.6.18-194.el5

  2.查看linux版本:

  1)列出所有版本信息,

  [root@localhost~]#lsb_release-a

  LSBVersion::core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch

  DistributorID:CentOS

  Description:CentOSrelease5.5(Final)

  Release:5.5

  Codename:Final

  注:这个命令适用于所有的linux,包括RedHat、SUSE、Debian等发行版。

  2)执行cat/etc/issue,例如如下:

  [root@localhost~]#cat/etc/issue

  CentOSrelease5.5(Final)

  Kernelronanm

  3)执行cat/etc/redhat-release,例如如下:

  [root@localhost~]#cat/etc/redhat-release

  CentOSrelease5.5(Final)

  查看系统是64位还是32位:

  1、getconfLONG_BITorgetconfWORD_BIT

  [root@localhost~]#getconfLONG_BIT

  64

  2、file/bin/ls

  [root@localhost~]#file/bin/ls

  /bin/ls:ELF64-bitLSBexecutable,AMDx86-64,version1(SYSV),forGNU/Linux2.6.9,dynamicallylinked(usessharedlibs),forGNU/Linux2.6.9,stripped

  3、lsb_release-a

  [root@localhost~]#lsb_release-a

  LSBVersion::core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch

  DistributorID:CentOS

  Description:CentOSrelease5.5(Final)

  Release:5.5

  Codename:Final

  4、或者是使用查看文件的方法。

  vim/ect/issue

  上面就是查看CentOS版本信息的介绍了,除了能够知道你使用的是哪个版本外,还能够查看你所使用的CentOS系统是32位还是64位的。


发表评论:

最近发表
网站分类
标签列表