CentOSのバージョンを確認する方法
CentOSのバージョン確認
ファイルから確認
CentOSのバージョンは/etc/redhat-releaseを確認することで知ることができます。
$ cat /etc/redhat-release
$ cat /etc/redhat-release CentOS Linux release 7.5.1804 (Core)
コマンドから確認
lsb_releaseコマンドを使用することで確認することができます。
$ lsb_release -a
LSB Version: :core-4.1-amd64:core-4.1-noarch:cxx-4.1-amd64:cxx-4.1-noarch:desktop-4.1-amd64:desktop-4.1-noarch:languages-4.1-amd64:languages-4.1-noarch:printing-4.1-amd64:printing-4.1-noarch Distributor ID: CentOS Description: CentOS Linux release 7.5.1804 (Core) Release: 7.5.1804 Codename: Core
lsb_releaseコマンドを使用するためにはredhat-lsbパッケージが必要なので、入ってない場合はyumでインストールします。
# yum install redhat-lsb