본문 바로가기

Engineering/Linux

각 OS 버전 확인 명령어

728x90

여러 OS 별로 OS 버전, 커널 버전을 확인할 수 있는 명령어와 관련 파일들을 정리해본다.

 

- Ubuntu, Debian

$ uname -a
Linux 8bf3ea62aee0 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release 
PRETTY_NAME="Ubuntu 22.04.3 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.3 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

 

- Rocky, Redhat, CentOS

$ uname -a
Linux hostName1 4.18.0-372.9.1.el8.x86_64 #1 SMP Tue May 10 14:48:47 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

$ cat /etc/os-release 
NAME="Rocky Linux"
VERSION="8.6 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.6"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.6 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="8"

 

- Mac

: POSIX 계열이라 uname 명령어로 커널 버전을 확인할 수 있다.

※ system_profiler : 시스템에 설치된 앱들의 상태(버전, 번들ID, 파일 위치, sign 여부, ...)를 텍스트로 표시하는 명령어. 명령어 실행할때 아무런 옵션없이 실행하면 한참동안 실행 결과가 스크롤되니깐 특정 옵션을 꼭 붙이자.

% uname -a
Darwin Host-MacBookPro.local 22.3.0 Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64 x86_64

% sw_vers
ProductName:		macOS
ProductVersion:		13.2.1
BuildVersion:		22D68

% system_profiler SPSoftwareDataType
Software:

    System Software Overview:

      System Version: macOS 13.2.1 (22D68)
      Kernel Version: Darwin 22.3.0
      Boot Volume: Macintosh HD
      Boot Mode: Normal
      Computer Name: User1의 MacBook Pro
      User Name: User1 (user1)
      Secure Virtual Memory: Enabled
      System Integrity Protection: Enabled
      Time since boot: 117일 21시간 36분

 

- Windows

: PowerShell 에서 "Get-ComputerInfo" 명령어로 버전, 제품명을 확인할 수 있다.

PS C:\Users> Get-ComputerInfo

WindowsBuildLabEx                                       : 19041.1.amd64fre.vb_release.191206-1406
WindowsCurrentVersion                                   : 6.3
WindowsEditionId                                        : Enterprise
WindowsInstallationType                                 : Client
WindowsInstallDateFromRegistry                          : 2021-08-31 오전 5:45:59
WindowsProductId                                        : 00329-00000-00003-AA798
WindowsProductName                                      : Windows 10 Enterprise
WindowsRegisteredOrganization                           :
WindowsRegisteredOwner                                  : 
WindowsSystemRoot                                       : C:\Windows
WindowsVersion                                          : 2009
BiosCharacteristics                                     : {7, 11, 12, 15...}
...

 

참고

https://www.cyberciti.biz/faq/mac-osx-find-tell-operating-system-version-from-bash-prompt/

https://en.wikipedia.org/wiki/MacOS_version_history