본문으로 바로가기

다양한 배포판의 릴리즈를 대응하기 위해서 설치된 리눅스 배포판 확인하는 방법.

[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