RHEL7.0以下,查看系统版本的方式:
[rusky@rheltest1 ~]$ cat /proc/version
Linux version 2.6.-.el6.x86_64 (mockbuild@x86-.build.bos.redhat.com) (gcc version 4.4. (Red Hat 4.4.-) (GCC) ) # SMP Wed Jun :: EDT
[rusky@rheltest1 ~]$ uname -a
Linux rheltest1.com 2.6.-.el6.x86_64 # SMP Wed Jun :: EDT x86_64 x86_64 x86_64 GNU/Linux
[rusky@rheltest1 ~]$ lsb_release -a
LSB Version: :core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.3 (Santiago)
Release: 6.3
Codename: Santiago
[rusky@rheltest1 ~]$ cat /etc/issue
Red Hat Enterprise Linux Server release 6.3 (Santiago)
Kernel \r on an \m [rusky@rheltest1 ~]$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
[rusky@rheltest1 ~]$
RHEL7版本中的新命令hostnamectl:
hostnamectl status这个命令很实用,主机名、操作系统版本、内核版本、系统架构...一个命令搞定。
[root@rhel7 ~]# hostnamectl status
Static hostname: rhel7.com
Icon name: computer-vm
Chassis: vm
Machine ID: c9e1b1f7c9514da7a2e9448646555486
Boot ID: 210401bc6bae46d5a5104eb767e42934
Virtualization: kvm
Operating System: Red Hat Enterprise Linux Server 7.2 (Maipo)
CPE OS Name: cpe:/o:redhat:enterprise_linux:7.2:GA:server
Kernel: Linux 3.10.-.el7.x86_64
Architecture: x86-
[root@rhel7 ~]#