LoginSignup
2
2

More than 5 years have passed since last update.

Linux OSのバージョンを調べる方法

Last updated at Posted at 2018-05-13

1. OSのディストリビューション名を調べる

cat /etc/os-release

[account /]$ 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"

2. ディストリビューションのバージョンを調べる

今回はCENTOSだったので以下のコマンドを実行

cat /etc/redhat-release

[account /]$ cat /etc/redhat-release
CentOS Linux release 7.4.1708 (Core)

※基本的には/etc/以下で[ディスロ名]-releaseファイルを探して中身を見れば解決

補足. Linuxカーネルのバージョンを調べる

以下のどちらでも良い

cat /proc/version

[account /]$ cat /proc/version
Linux version 4.4.0-121-generic (buildd@lcy01-amd64-004) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9) ) #145-Ubuntu SMP Fri Apr 13 13:47:23 UTC 2018

 ⇨なぜにUbuntu文字が???

uname -a

[account /]$ uname -a
Linux localhost 4.4.0-121-generic #145-Ubuntu SMP Fri Apr 13 13:47:23 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2