要获取系统版本,可以使用以下方法之一:
请注意,不同的操作系统可能有不同的方法来获取系统版本。上述方法适用于常见的操作系统,但可能不适用于所有情况。
-
在Windows上,可以按下Win + R键,然后输入"winver"并按下Enter键。这将打开一个窗口,显示当前安装的Windows版本。
-
在Mac上,可以点击左上角的苹果图标,然后选择"关于本机"。在弹出的窗口中,可以看到当前的MacOS版本。
-
在Linux上,可以打开终端,并输入以下命令之一:
-
lsb_release -a
:显示Linux发行版的详细信息,包括版本号。 -
cat /etc/os-release
:显示操作系统的版本信息。
-
一下centos示例:
[root@VM-0-17-tencentos software]# lsb_release -a
bash: lsb_release: command not found...
Install package 'redhat-lsb-core' to provide command 'lsb_release'? [N/y] y
* Waiting in queue...
* Loading list of packages....
The following packages have to be installed:
cups-client-1:2.2.6-50.tl3.x86_64 CUPS printing system - client programs
ncurses-compat-libs-6.1-9.20180224.tl3.x86_64 Ncurses compatibility libraries
redhat-lsb-core-4.1-47.tl3.x86_64 LSB Core module support
redhat-lsb-submod-security-4.1-47.tl3.x86_64 LSB Security submodule support
spax-1.5.3-13.tl3.x86_64 Portable archive exchange
util-linux-user-2.32.1-42.tl3.x86_64 libuser based util-linux utilities
Proceed with changes? [N/y] y
* Waiting in queue...
* Waiting for authentication...
* Waiting in queue...
* Downloading packages...
* Requesting data...
* Testing changes...
* Installing packages...
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.6.2205 (Core)
Release: 8.6.2205
Codename: Core
[root@VM-0-17-tencentos software]# lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: CentOS
Description: CentOS Linux release 8.6.2205 (Core)
Release: 8.6.2205
Codename: Core
[root@VM-0-17-tencentos software]#