برای این کار کافیست عبارت زیر را درج کنید:
# cat /etc/centos-release CentOS Linux release 7.1.1503 (Core)
در ادامه می بینید که سیستم عامل نسخه خود را معرفی می کند. که در این مثال نسخه 7.1 سیستم عامل centos است.
راه های دیگری هم وجود دارد. مثلا در CentOS نسخه 7 می توان نوشت:
# hostnamectl Static hostname: localhost.localdomain Icon name: computer-laptop Chassis: laptop Machine ID: 6892999b8d8c43fab29fca961dbff24b Boot ID: b0a95bf56f61417ca8073b3847a73ab1 Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-229.7.2.el7.x86_64 Architecture: x86_64
یا در همه نسخه های CentOS و یا Fedora می توان نوشت:
# rpm --query centos-release centos-release-7-1.1503.el7.centos.2.8.x86_64
برای دستور اولی که نوشتم جایگزین های دیگری هم هست. مانند هر یک از دستورات زیر:
# cat /etc/centos-release CentOS Linux release 7.1.1503 (Core) # 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" # cat /etc/redhat-release CentOS Linux release 7.1.1503 (Core) # cat /etc/system-release CentOS Linux release 7.1.1503 (Core)