检查 ubuntu 版本
In this tutorial, we will go over the easiest methods to check Ubuntu version from the terminal. You can use any of the methods below depending on what you need. The outputs that the commands provide are very basic, but at the end of the tutorial, we’ve shown some APT packages that give the version information, in a really beautiful ASCII format.
在本教程中,我们将介绍从终端检查Ubuntu版本的最简单方法。 您可以根据需要使用以下任何方法。 这些命令提供的输出是非常基本的,但是在本教程的最后,我们展示了一些APT软件包,它们以非常漂亮的ASCII格式提供了版本信息。
包含Ubuntu版本详细信息的文件 (Files That Contain Ubuntu Version Details)
There are a few configuration files that contain details of the version and the release information of the Linux distribution you’re on. So, if you’re looking for files that can provide you with the required details, keep reading.
有一些配置文件,其中包含版本详细信息以及您所使用的Linux发行版的发行信息。 因此,如果您正在寻找可以为您提供所需详细信息的文件,请继续阅读。
1. LSB发布文件 (1. LSB-Release File)
LSB stands for Linux Standard Base. The lsb-release file is located in /etc/lsb-release directory. We can run the cat command to output the contents of this file.
LSB代表Linux Standard Base。 lsb-release文件位于/ etc / lsb-release目录中。 我们可以运行cat命令来输出该文件的内容。
root@ubuntu:~# cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=18.04
DISTRIB_CODENAME=bionic
DISTRIB_DESCRIPTION="Ubuntu 18.04.3 LTS"