Linux—系统管理

查看系统版本centos

CentOS系统bash

# centos7查看命令
[root@localhost ~]# cat /etc/os-release

# centos6/7通用命令
[root@localhost ~]# cat /etc/redhat-release
[root@localhost ~]# cat /etc/redhat-release | sed -r 's/.* ([0-9]+)\..*/\1/'

# centos6/7通用命令
[root@localhost ~]# cat /etc/centos-release
[root@localhost ~]# cat /etc/centos-release | sed -r 's/.* ([0-9]+)\..*/\1/'

# centos6/7通用命令
[root@localhost ~]# rpm -q centos-release
[root@localhost ~]# rpm -q centos-release | cut -d- -f3

# radhat或centos存在/etc/redhat-release这个文件。【命令 cat /etc/redhat-release】
相关文章
相关标签/搜索