背景描述:
今天需要统计操作系统版本,我在其中一台主机上执行cat /etc/redhat-release发现没有这个,应该知道不是redhat系统,然后想,怎么查来着,忘了,找了下,再此记录下。
### 查看操作系统及版本信息:
1.cat /etc/issue
txprd@xxx806:~> cat /etc/issue Welcome to SUSE Linux Enterprise Server 11 SP2 (x86_64) - Kernel (l).
2.lsb_release -a
txprd@xxxx806:~> lsb_release -a LSB Version: core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64:desktop-4.0-amd64:desktop-4.0-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.2-amd64:graphics-3.2-noarch:graphics-4.0-amd64:graphics-4.0-noarch Distributor ID: SUSE LINUX Description: SUSE Linux Enterprise Server 11 (x86_64) Release: 11 Codename: n/a
3.如果是redhat、centos,执行cat /etc/redhat-release
[root@abc-xxx-14 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.6 (Santiago)
文档创建时间:2019年6月4日13:59:56