查看發行版
通常在 /etc
目錄中會有有一些名為*-release
的系統文件
使用ls -l
查看下
ls -l /etc/*-release
-rw-r--r-- 1 root root 27 Mar 28 18:25 /etc/centos-release
lrwxrwxrwx 1 root root 14 Apr 15 10:12 /etc/redhat-release -> centos-release
lrwxrwxrwx 1 root root 14 Apr 15 10:12 /etc/system-release -> centos-release
我們cat
查看下centos-release
cat /etc/centos-release
CentOS release 6.9 (Final)
這里我們就看到了當前的發行版
以及對應的型號
還有一個是os-release
文件,里面的信息更加詳細
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"
本人操作的是Centos6
的機器,貌似沒看到os-release
文件,倒是在Centos7
的機子是看到了,上面的輸出是我從Centos7
拷來的
查看內核版本,使用uname
命令
uname -a
Linux localhost.localdomain 2.6.32-696.1.1.el6.x86_64 #1 SMP Tue Apr 11 17:13:24 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux