查看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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容