본문 바로가기

OS/Unix, Linux

CentOS 운영체제 정보 확인

운영체제 설치 버전 확인

CentOS 콘솔에서 cat /etc/*release* 또는 cat /etc/*-release | uniq를 사용합니다.

shell
닫기
$ cat /etc/*release* CentOS Linux release 7.9.2009 (Core) Derived from Red Hat Enterprise Linux 7.9 (Source) 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" CentOS Linux release 7.9.2009 (Core) CentOS Linux release 7.9.2009 (Core) cpe:/o:centos:centos:7
닫기

AWS EC2에서 호스팅되는 CentO는 rpm --eval '%{centos_ver}'를 사용합니다.

shell
닫기
$ rpm --eval '%{centos_ver}' 7

커널 정보 확인

커널 정보는 uname -r uname -a 또는 cat /proc/version을 사용합니다.

shell
닫기
$ uname -r 3.10.0-1160.76.1.el7.x86_64 $ uname -a Linux ip-172-31-5-103.ap-northeast-2.compute.internal 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux $ cat /proc/version Linux version 3.10.0-1160.76.1.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) ) #1 SMP Wed Aug 10 16:21:17 UTC 2022

지원하는 Bit 수 확인

32 Bit 또는 64 Bit와 같이 지원하는 Bit를 확인하려면 getconf LONG_BIT를 사용합니다.

shell
닫기
$ getconf LONG_BIT 64

정리 및 복습

  • 운영체제 설치 버전을 확인하려면 cat /etc/*release* 또는 cat /etc/*-release | uniq를 사용합니다.
  • AWS EC2에서 호스팅되고 있다면 rpm --eval '%{centos_ver}'를 사용합니다.
  • 커널 정보를 확인하려면 uname -r uname -a 또는 cat /proc/version을 사용합니다.
  • 지원하는 Bit를 확인하려면 getconf LONG_BIT를 사용합니다.