查看 Linux 系统版本命令
-
cat /etc/issue
-
cat /etc/redhat-release
-
lsb_release -a
实例:
[root@iZ11k ~]# cat /etc/issue
CentOS release 6.5 (Final)
Kernel \r on an \m
[root@iZ11k ~]# cat /etc/redhat-release
CentOS release 6.5 (Final)
[root@iZ11k ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.5 (Final)
Release: 6.5
Codename: Final
[root@iz ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@iz ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
[root@iz ~]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 7.3.1611 (Core)
Release: 7.3.1611
Codename: Core
[root@sv ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@sv ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@sv ~]# 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
[root@mai ~]# cat /etc/issue
\S
Kernel \r on an \m
[root@mai ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@mai ~]# lsb_release -a
-bash: lsb_release: command not found
[root@mai ~]# yum install redhat-lsb -y
....
分析:
-
cat /etc/issue
不适用 centos7 -
cat /etc/redhat-release
只适用于 Redhat 系列的 linux -
lsb_release -a
需要安装该工具才可以使用 ,安装命令yum install redhat-lsb -y
补充一个一键测试脚本
脚本来源:Bench.sh
可以使用以下命令来查看您的 Linux 系统信息,还可以测试网络带宽及硬盘读写速率
wget -qO- bench.sh | bash
#或者
curl -Lso- bench.sh | bash
上个运行结果图:
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于