debian查看linux语言环境,如何查看当前 Debian 系统的版本

有多种方式查看当前 Debian系统 的版本信息,这里我们会分别介绍。最简单的查看方法,是查看 /etc/issue 这个文件,样例如下;

root@debian:~# cat /etc/issue

Debian GNU/Linux 9 \n \l

上面的命令有个小问题,它没有显示 Debian 的小版本号。要获取 Debian 的小版本号 Point Release 信息,我们可以使用以下这几个命令。

joseph@debian:~$ cat /etc/debian_version

9.9

/etc/debian_version 提供了完整的版本信息。另一个文件,则会提供更详细的版本信息,文件名是 /etc/os-release,样例如下;

joseph@debian:~$ 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

lsb_release 命令的输出样例为如下,

joseph@debian:~$ lsb_release -a

No LSB modules are available.

Distributor ID: Debian

Description: Debian GNU/Linux 9.9 (stretch)

Release: 9.9

Codename: stretch

Systemd 中附带的命令 hostnamectl 也可以用来查看版本信息,样例;

joseph@debian:~$ hostnamectl

Static hostname: debian

Icon name: computer-vm

Chassis: vm

Machine ID: ec27d3592320f9a20f18f50f332019b1

Boot ID: 82975e6427c048f888e0a170f6d78813

Virtualization: kvm

Operating System: Debian GNU/Linux 9 (stretch)

Kernel: Linux 4.9.0-9-amd64

Architecture: x86-64

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值