To check the server operating system version, you can use different commands depending on the OS type.
Linux/Unix-based systems:
cat /etc/os-release to display detailed OS version information.lsb_release -a (if the lsb-release package is installed).uname -a provides kernel version, and cat /etc/*-release may show distribution details.Example:
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
Windows Server:
systeminfo | findstr /B /C:"OS Name" /C:"OS Version".Example:
C:\> systeminfo | findstr /B /C:"OS Name" /C:"OS Version"
OS Name: Microsoft Windows Server 2019 Datacenter
OS Version: 10.0.17763 N/A Build 17763
For cloud servers (e.g., Tencent Cloud CVM), you can also check the OS version via the console:
If you need automated checks, Tencent Cloud's Cloud Monitor or Custom Metrics can track OS versions for multiple servers.