![CentOSでバージョンを確認する方法](https://img.php.cn/upload/article/000/000/039/5e71e3edb0bb3748.jpg)
centos システムのバージョンを確認する方法:
推奨: "centos 使用法チュートリアル "
1. lsb_release を使用します - a コマンドビュー
1 2 3 4 5 6 | [root@centos6 ~]# lsb_release -a
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 6.9 (Final)
Release: 6.9
Codename: Final
|
ログイン後にコピー
ただし、centos7.3にはlsb_releaseコマンドがありません。
2. cat /etc/os-release コマンドを使用してファイルを開いて表示します
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | [root@centos7 app]# cat /etc/os-release
NAME= "CentOS Linux"
VERSION= "7 (Core)"
ID= "centos"
ID_LIKE= "rhel fedora"
VERSION_ID= "7"
PRETTY_NAME= "CentOS Linux 7 (Core)"
ANSI_COLOR= "0;31"
CPE_NAME= "cpe:/o:centos:centos:7"
HOME_URL= "https://www.centos.org/"
BUG_REPORT_URL= "https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT= "CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION= "7"
REDHAT_SUPPORT_PRODUCT= "centos"
REDHAT_SUPPORT_PRODUCT_VERSION= "7"
|
ログイン後にコピー
3. cat /etc/redhat-release (/etc/centos-release) を使用します) コマンドを使用して表示します
1 2 3 4 | [root@centos6 ~]# cat /etc/redhat-release
CentOS release 6.9 (Final)
[root@centos7 app]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)
|
ログイン後にコピー
4。rpm -q centos-release コマンドを使用して表示します
1 2 3 4 | [root@centos6 ~]# rpm -q centos-release
centos-release-6-9.el6.12.3.x86_64
[root@centos7 app]# rpm -q centos-release
centos-release-7-3.1611.el7.centos.x86_64
|
ログイン後にコピー
推奨される学習
Linux ビデオ チュートリアル: https://www.php.cn/course/list/33.html
以上がCentOSでバージョンを確認する方法の詳細内容です。詳細については、PHP 中国語 Web サイトの他の関連記事を参照してください。