バージョン確認いろいろ

2025年7月6日 11時21分

Linux

Linux OSのバージョン確認方法をまとめてみた

cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Ubuntu

cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=22.04
DISTRIB_CODENAME=jammy
DISTRIB_DESCRIPTION="Ubuntu 22.04.3 LTS"

Cent OS/Red Hat

cat /etc/redhat-release
CentOS Linux release 7.6.1810 (Core)

PHP

Windows の場合は、php.exe のあるフォルダに移動して実行

php -v
PHP 7.3.21 (cli) (built: Aug  4 2020 08:06:20) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.21, Copyright (c) 1998-2018 Zend Technologies

Apache

Windows の場合は、httpd.exe(apache\bin)のあるフォルダに移動して実行

httpd -v
Server version: Apache/2.4.6 (CentOS)
Server built:   Apr  2 2020 13:13:23

PostgreSQL

psqlコマンドで確認する方法
psql --version
psql (PostgreSQL) 9.2.24
PostgreSQLに接続して確認する方法
psql -U aipo_postgres -d org001
psql (9.2.24, サーバー 11.6)