アカウント名:
パスワード:
$ lsb_release -aNo LSB modules are available.Distributor ID: DebianDescription: Debian GNU/Linux 11 (bullseye)Release: 11Codename: bullseye
Debian/Ubuntu限定。RedHat系などは使ってないので知らない。
今なら/etc/os-releaseファイルを使うのがいいと思います。今はたいていのLinuxディストリビューションで用意されています。
https://www.freedesktop.org/software/systemd/man/os-release.html [freedesktop.org]
Debian
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"NAME="Debian GNU/Linux"VERSION_ID="11"VERSION="11 (bullseye)"VERSION_CODENAME=bullseyeID=debianHOME_URL="https://www.debian.org/"SUPPORT_URL="https://www.debian.org/support"BUG_REPORT_URL="https://bugs.debian.org/"
CentOS
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"
Ubuntu, ArchLinux, AlpineLinuxにもあります。たしかGentooにもありました。
変わったところでは、FreeBSDも用意してくれています。
https://man.freebsd.org/cgi/man.cgi?query=os-release&sektion=&... [freebsd.org]
より多くのコメントがこの議論にあるかもしれませんが、JavaScriptが有効ではない環境を使用している場合、クラシックなコメントシステム(D1)に設定を変更する必要があります。
アレゲはアレゲを呼ぶ -- ある傍観者
lsb_release(1)はバージョン確認に便利なんだけど (スコア:2, すばらしい洞察)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Debian/Ubuntu限定。
RedHat系などは使ってないので知らない。
Re:lsb_release(1)はバージョン確認に便利なんだけど (スコア:0)
今なら/etc/os-releaseファイルを使うのがいいと思います。今はたいていのLinuxディストリビューションで用意されています。
https://www.freedesktop.org/software/systemd/man/os-release.html [freedesktop.org]
Debian
CentOS
Ubuntu, ArchLinux, AlpineLinuxにもあります。たしかGentooにもありました。
変わったところでは、FreeBSDも用意してくれています。
https://man.freebsd.org/cgi/man.cgi?query=os-release&sektion=&... [freebsd.org]