查看linux內核以及發行版本

查看發行版

通常在 /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

最后編輯于
?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容