다양한 배포판의 릴리즈를 대응하기 위해서 설치된 리눅스 배포판 확인하는 방법.
[ihmin@localhost ~]$ lsb_release -i
Distributor ID: CentOS
[ihmin@localhost ~]$ lsb_release -d
Description: CentOS release 5.7 (Final)
[ihmin@localhost ~]$ lsb_release -r
Release: 5.7
[ihmin@localhost ~]$ lsb_release -c
Codename: Final
[ihmin@localhost ~]$ lsb_release -a
LSB Version: :core-4.0-ia32:core-4.0-noarch:graphics-4.0-ia32:graphics-4.0-noarch:printing-4.0-ia32:printing-4.0-noarch
Distributor ID: CentOS
Description: CentOS release 5.7 (Final)
Release: 5.7
Codename: Final
[ihmin@localhost ~]$
ihmin@ubuntu:~$ lsb_release -i
Distributor ID: Ubuntu
ihmin@ubuntu:~$ lsb_release -d
Description: Ubuntu 10.10
ihmin@ubuntu:~$ lsb_release -r
Release: 10.10
ihmin@ubuntu:~$ lsb_release -c
Codename: maverick
ihmin@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 10.10
Release: 10.10
Codename: maverick
ihmin@ubuntu:~$
대충 -i 옵션으로 아래와 같이 사용하면 될 것 같음.
[ihmin@localhost ~]$ echo `lsb_release -i | cut -d':' -f2`
CentOS
ihmin@ubuntu:~$ echo `lsb_release -i | cut -d':' -f2`
Ubuntu
'블로그 (Blog) > 개발로그 (Devlogs)' 카테고리의 다른 글
NSIS 64비트 지원을 위한 팁 (0) | 2025.02.18 |
---|---|
VMware 공유폴더 지정 (0) | 2025.02.18 |
C에서 JNI를 사용하여 Java 함수 호출하기 (0) | 2025.02.17 |
한글 구현 및 글꼴(폰트) 처리 관련 C소스코드 자료 모음집 (0) | 2025.02.17 |
PHP 스크립트 (0) | 2025.02.17 |