几种查看CentOS版本信息的方法

几种查看CentOS版本信息的方法

1. 查看CentOS的kernel版本

查看文件/proc/version

# cat /proc/version 
Linux version 3.10.0-229.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC) ) #1 SMP Fri Mar 6 11:36:42 UTC 2015

通过uname命令查看

# uname -r
3.10.0-229.el7.x86_64

uname命令参数说明

  -a, --all                print all information, in the following order,
                             except omit -p and -i if unknown:
  -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 or "unknown"
  -i, --hardware-platform  print the hardware platform or "unknown"
  -o, --operating-system   print the operating system

2. 查看CentOS系统版本

查看文件/etc/centos-release/etc/redhat-release

# cat /etc/centos-release
CentOS Linux release 7.2.1511 (Core) 

# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)

查看文件/etc/issue,注意:在centos7中没有具体信息。

# cat /etc/issue
\S
Kernel \r on an \m

查看文件/etc/redhat-release

# cat /etc/redhat-release 
CentOS Linux release 7.1.1503 (Core)

LSB是Linux Standard Base的缩写,lsb_release命令用来显示LSB和特定版本的相关信息。
这个命令适用于所有的linux,包括Redhat、SuSE、Debian、Centos等发行版。
-a, --all 就是显示所有信息,显示包括版本信息、发行版的ID、发行版的描述信息、具体版本号、发行版代号的信息。

# yum install -y redhat-lsb-core

# lsb_release -d
Description:    CentOS Linux release 7.1.1503 (Core) 

# lsb_release -a
LSB Version:    :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description:    CentOS Linux release 7.2.1511 (Core) 
Release:    7.2.1511
Codename:   Core

lsb_release的具体可以用lsb_release -h查看帮助

  -i, --id
    Display the string id of the distributor.
  -d, --description
    Display the single line text description of the distribution.
  -r, --release
    Display the release number of the distribution.
  -c, --codename
    Display the codename according to the distribution release.
  -a, --all
    Display all of the above information.
  -s, --short
    Use short output format for information requested by other options (or version if none).

3. 查看系统是64位还是32位

x86_64 是 64位
i386 i686 都是32位

# uname -i
x86_64

也可以通过file命令查看系统命令来确定。

# 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

参考

几种查看CentOS版本信息的办法

转载于:https://www.cnblogs.com/seerjk/p/5103967.html

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值