Logo

How to Check OS Version in Linux Command?

How to check OS Version in Linux Command? Linux is a free and open-source operating system having many variants of Linux distribution such as OpenSUSE, Debian, Ubuntu, CentOS, Arch, Fedora, RHEL all are common Linux distribution names. During your server maintenance and update, you need to know the installed OS version and name on your server for security patches, upgrading files.

In this article, we will guide you about how to check the Operating System details using the command line in Linux.

How to check OS version in Linux?

Using os-release file available in Linux’s etc directory.

Command:

# cat /etc/os-release 

Output:

NAME="openSUSE Leap"
VERSION="42.2"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.2"
PRETTY_NAME="openSUSE Leap 42.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
Scroll to Top