Check the OS Version in Linux

https://www.geeksforgeeks.org/how-to-check-the-os-version-in-linux/#

1. cat /etc/os-release

1
cat /etc/os-release
Example
1
2
3
4
5
6
7
8
9
10
11
12
13
PRETTY_NAME="Ubuntu 24.04 LTS"
NAME="Ubuntu"
VERSION_ID="24.04"
VERSION="24.04 LTS (Noble Numbat)"
VERSION_CODENAME=noble
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=noble
LOGO=ubuntu-logo

2. lsb_release -a

1
lsb_release -a
Example
1
2
3
4
Distributor ID: Ubuntu
Description: Ubuntu 24.04 LTS
Release: 24.04
Codename: noble

3. hostnamectl

1
hostnamectl
Example
1
2
3
4
5
6
7
8
9
10
       Icon name: computer-desktop
Chassis: desktop 🖥️
Operating System: Ubuntu 24.04 LTS
Kernel: Linux 6.8.0-41-generic
Architecture: x86-64
Hardware Vendor: Micro-Star International Co., Ltd.
Hardware Model: MS-7D25
Firmware Version: 1.D0
Firmware Date: Mon 2023-07-10
Firmware Age: 1y 2month 2d

4. uname -r

Check the Linux Kernel version:

1
uname -r
Example
1
6.8.0-41-generic

5. dmesg | grep Linux

1
dmesg | grep Linux
Example
1


Check the OS Version in Linux
https://www.hardyhu.cn/2024/09/10/Check-the-OS-Version-in-Linux/
Author
John Doe
Posted on
September 10, 2024
Licensed under