Linux OS 버전 확인하기

Jeffery Lim·2021년 9월 12일

linux tip

목록 보기
1/1

1. Debian/Ubuntu 리눅스 버전 확인

방법1. cat /etc/os-release

2010년에 나온 systemd 가 리눅스의 주류가 된 시점에 가장 확실한 방법이다.
systemd가 좋다 나쁘다 시끄러웠지만 lsb_release는 나쁜 방법이라 생각한다.

$ cat /etc/os-release
PRETTY_NAME="Kali GNU/Linux Rolling"
NAME="Kali GNU/Linux"
ID=kali
VERSION="2021.3"
VERSION_ID="2021.3"
VERSION_CODENAME="kali-rolling"
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="https://www.kali.org/"
SUPPORT_URL="https://forums.kali.org/"
BUG_REPORT_URL="https://bugs.kali.org/"

배포판 이름과 버전 정보와 같은 필요한 정보가 확인된다.

방법2. lsb_release 명령어

이미 LTS 버전이 넘어간 우분투/데비안이라면 아마 이 명령어가 가장 정확한 해답이 될것이다.

lsb_release 명령어는 man 파일에서 확인하면

The lsb_release command provides certain LSB (Linux Standard Base) and distribution-specific information.

1. 옵션 -a

$ lsb_release -a
No LSB modules are available.
Distributor ID: Kali
Description:    Kali GNU/Linux Rolling
Release:        2021.3
Codename:       kali-rolling

전체 결과값을 알수 있고 아마 대부분은 Kali 라는 배보판 명과 Release 정보가 필요할것이다.

2. 옵션 -r

$ lsb_release -r
Release:        2021.3

릴리즈 정보만 확인한다. 2021.3

3. 옵션 -i

$ lsb_release -i
Distributor ID: Kali

2. Rhel/CentOS 리눅스 버전 확인

$ cat /etc/os-release
$ cat /etc/system-release

3. Kernel 버전 확인

$ uname -s -r
Linux 4.19.104-microsoft-standard

0개의 댓글