カーネルのバージョン確認

| ⊗ |

[演習] 1 の実行結果

$ uname -a
Linux cent79.myhome 3.10.0-1160.11.1.el7.x86_64 #1 SMP Fri Dec 18 16:34:56 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ uname -r
3.10.0-1160.11.1.el7.x86_64
$ cat /proc/version
Linux version 3.10.0-1160.11.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Fri Dec 18 16:34:56 UTC 2020

[演習] 2 の実行結果

カーネルのソースを確認するためには、kernel-devel パッケージが必要です。
$ head /usr/src/kernels/3.10.0-1160.11.1.el7.x86_64/Makefile
VERSION = 3
PATCHLEVEL = 10
SUBLEVEL = 0
EXTRAVERSION = -1160.11.1.el7.x86_64
NAME = Unicycling Gorilla
RHEL_MAJOR = 7
RHEL_MINOR = 9
RHEL_RELEASE = 1160.11.1

その他

$ 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/centos-release
CentOS Linux release 7.9.2009 (Core)

$ ls -l /etc/*-release
-rw-r--r--. 1 root root 37 11月 24 00:08 /etc/centos-release
lrwxrwxrwx. 1 root root 21  1月 24 15:11 /etc/os-release -> ../usr/lib/os-release
lrwxrwxrwx. 1 root root 14  1月 24 15:11 /etc/redhat-release -> centos-release
lrwxrwxrwx. 1 root root 14  1月 24 15:11 /etc/system-release -> centos-release

(おまけ) MacBook
$ uname -a
Darwin ycos-Mac.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:07:06 PST 2021; root:xnu-7195.81.3~1/RELEASE_X86_64 x86_64