사용중인 리눅스 종류 및 버전 확인 방법
1 방법 1: /etc/*-release
- 명령어
grep . /etc/*-release
cat /etc/*-release | uniq
- 실행예시 (Ubuntu 14.04.3)
root@zetawiki:~# grep . /etc/*-release
/etc/lsb-release:DISTRIB_ID=Ubuntu
/etc/lsb-release:DISTRIB_RELEASE=14.04
/etc/lsb-release:DISTRIB_CODENAME=trusty
/etc/lsb-release:DISTRIB_DESCRIPTION="Ubuntu 14.04.3 LTS"
/etc/os-release:NAME="Ubuntu"
/etc/os-release:VERSION="14.04.3 LTS, Trusty Tahr"
/etc/os-release:ID=ubuntu
/etc/os-release:ID_LIKE=debian
/etc/os-release:PRETTY_NAME="Ubuntu 14.04.3 LTS"
/etc/os-release:VERSION_ID="14.04"
/etc/os-release:HOME_URL="http://www.ubuntu.com/"
/etc/os-release:SUPPORT_URL="http://help.ubuntu.com/"
/etc/os-release:BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
- 실행예시 (CentOS 6.5)
[root@zetawiki ~]# grep . /etc/*-release
/etc/centos-release:CentOS release 6.5 (Final)
/etc/lsb-release:LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
/etc/redhat-release:CentOS release 6.5 (Final)
/etc/system-release:CentOS release 6.5 (Final)
- 실행예시 (Fedora 11 Leonidas)
[root@zetawiki ~]# cat /etc/*-release | uniq
Fedora release 11 (Leonidas)
- 실행예시 (Oracle Enterprise Linux Server 5.5)
[root@zetawiki ~]# cat /etc/*-release | uniq
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Red Hat Enterprise Linux Server release 5.5 (Tikanga)
- 실행예시 (SUSE Linux Enterprise Server 11)
zetawiki:~ # cat /etc/*-release | uniq
SUSE Linux Enterprise Server 11 (x86_64)
VERSION = 11
PATCHLEVEL = 1
LSB_VERSION="core-2.0-noarch:core-3.2-noarch:core-4.0-noarch:core-2.0-x86_64:core-3.2-x86_64:core-4.0-x86_64"
2 방법 2: /etc/issue*
- 명령어
grep . /etc/issue*
- 배포판의 버전을 가장 쉽게 확인할 수 있는 방법이다.
- 보안 등의 이유로 다른 내용으로 바뀌어 있는 경우도 있다.
- 실행예시 (Ubuntu 14.04.3)
root@zetawiki:~# grep . /etc/issue*
/etc/issue:Ubuntu 14.04.3 LTS \n \l
/etc/issue.net:Ubuntu 14.04.3 LTS
- 실행예시 (CentOS 6.5)
[root@zetawiki ~]# grep . /etc/issue*
/etc/issue:CentOS release 6.5 (Final)
/etc/issue:Kernel \r on an \m
/etc/issue.net:CentOS release 6.5 (Final)
/etc/issue.net:Kernel \r on an \m
- 실행예시 (Fedora 11)
[root@zetawiki ~]# cat /etc/issue
Fedora release 11 (Leonidas)
Kernel \r on an \m (\l)
- 실행예시 (Oracle Enterprise Linux 5.5)
[root@zetawiki ~]# cat /etc/issue
Enterprise Linux Enterprise Linux Server release 5.5 (Carthage)
Kernel \r on an \m
- 실행예시 (SUSE Linux Enterprise Server 11)
zetawiki:~ # cat /etc/issue
Welcome to SUSE Linux Enterprise Server 11 SP1 (x86_64) - Kernel \r (\l).
3 방법 3: rpm (레드햇계열)
rpm -qa *-release
- 실행예시 (CentOS 6.2)
[root@zetawiki ~]# rpm -qa *-release
centos-release-6-2.el6.centos.7.x86_64
- 실행예시 (Fedora 11 Leonidas)
[root@zetawiki ~]# rpm -qa *-release
fedora-release-11-1.noarch
- 실행예시 (Oracle Enterprise Linux Server 5.5)
[root@zetawiki ~]# rpm -qa *-release
enterprise-release-5-0.0.22
- 실행예시 (SUSE Linux Enterprise Server 11)
zetawiki:~ # rpm -qa *-release
sles-release-11.1-1.152
lsb-release-2.0-1.2.18
[제타위키내용 퍼왔습니다]
'Database & Server Tip > Linux' 카테고리의 다른 글
[Linux] 특정 문자를 제외하고 보기? (grep) (0) | 2017.11.09 |
---|---|
[Linux] 파일명이 깨진파일 지우기 (0) | 2017.09.01 |
[Linux/Unix] VI 사용법! 명령어 모음 (0) | 2016.04.08 |
[설치] APM 소스 설치시 주요 에러 해결 방법 (0) | 2015.04.02 |
[VI편집기] VI 에서 유용한 찾기/바꾸기 명령들 (0) | 2014.12.29 |