To find your Linux OS version, run lsb_release -a or cat /etc/os-release in the terminal. These commands display your distribution name and version number.
Linux stores version information in several files. The most common commands read these files and format the output for users. When you run these commands, they access system files containing version details and display them in a readable format.
| Command | Description |
|---|---|
lsb_release -a |
Shows distribution ID, release number, codename, and description |
cat /etc/os-release |
Displays detailed OS identification data in key=value pairs |
hostnamectl |
Shows host name, operating system kernel, architecture, and OS ID |
cat /etc/issue |
Displays basic system information including OS version |
Different Linux distributions store version information in different files. For example, Ubuntu uses /etc/os-release, while CentOS uses /etc/redhat-release. Most modern distributions support the standard /etc/os-release file, which was introduced to provide consistent version information across different Linux distributions.
Knowing your Linux version is useful for troubleshooting, software compatibility checks, and system administration tasks. For instance, when installing new software, you might need to verify that your Linux distribution meets the minimum version requirements. System administrators often need this information for maintenance and security updates.
I once needed to find my Linux version when installing a new database management system. The software required a specific version of Ubuntu, and running lsb_release -a quickly confirmed whether my system met the requirements.