Cross-distro
All distros running Systemd
are required to have the file /etc/os-release
containing information about your distro.
$ cat /etc/os-release
NAME=Fedora
VERSION="24 (Workstation Edition)"
ID=fedora
VERSION_ID=24
PRETTY_NAME="Fedora 24 (Workstation Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:24"
HOME_URL="https://fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=24
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=24
PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
VARIANT="Workstation Edition"
VARIANT_ID=workstation
Fedora / RHEL
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 7.2 (Maipo)
Debian
$ cat /etc/debian_version
8.5
Ubuntu
The lsb_release
command prints certain LSB (Linux Standard Base) and
Distribution information.
$ lsb_release -a
No LSB modules are available.
Distributor ID:Ubuntu
Description:Ubuntu 10.04.3 LTS
Release:10.04
Codename:lucid