最简单方法是查看/etc/issue文件
root@debian:~# cat /etc/issue Debian GNU/Linux 9 \n \l
但是,上面的命令可能不会显示当前的Debian更新点版本(update point releases)。
因此,我们可以使用以下Linux命令获得更准确的信息:
root@debian:~# cat /etc/debian_version 9.0
接下来,我们可以检查/etc/OS-Release
发布文件:
# 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/"
另一种方法是使用“LSB_Release”命令。
默认情况下可能缺少此命令,因此我们可能首先安装它:
# apt-get install lsb-release
安装上面的包运行以下Linux命令后,查看我们在Debian框中运行的debian版本:
$lsb_release -da No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 9.0 (stretch) Release: 9.0 Codename: stretch
对于“systemd deaian版本”,我们也可以使用“HostNamectl”:
# hostnamectl Static hostname: debian Icon name: computer-vm Chassis: vm Machine ID: 6866ec1d654b4a2ea52d591dc0146d82 Boot ID: 51bfbc1e197b4d378e95073da0df0288 Virtualization: xen Operating System: Debian GNU/Linux 9 (stretch) Kernel: Linux 4.9.0-1-amd64 Architecture: x86-64
日期:2020-07-07 20:56:01 来源:oir作者:oir