查看版本当前操作系统内核信息
$ uname -a
Linux elcndc5r21n10 3.10.0-1127.el7.x86_64 #1 SMP Tue Mar 31 23:36:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
cat/proc/version
查看当前操作系统版本信息
$ cat /proc/version
Linux version 3.10.0-1127.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) ) #1 SMP Tue Mar 31 23:36:51 UTC 2020
cat/etc/issue
查看版本当前操作系统发行信息
$ cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
cat/etc/*-releasecat/etc/os-release,cat/etc/centos-release,cat/etc/rethat-release
包括有关发行版本的信息。该文件是systemd软件包的一部份,而且所有运行systemd的Linux系统都应具有此文件。
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
$cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
hostnamectl
$ hostnamectl
Static hostname: debian9.localdomain
Icon name: computer-vm
Chassis: vm
Machine ID: a92099e30f704d559adb18ebc12ddac4
Boot ID: 7607cbe605d44f638d6542d4c7b3878e
Virtualization: qemu
Operating System: Debian GNU/Linux 9 (stretch)
Kernel: Linux 4.9.0-8-amd64
Architecture: x86-64