How to Check Linux Version
Here are some different commands to show the OS version and distribution information
lsb_release
command
The lsb_release
utility displays LSB (Linux Standard Base) information about the Linux distribution. This command should work on all Linux distributions that have the lsb-release
package installed:
lsb_release -a
~/scripts$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.1 LTS
Release: 22.04
Codename: jammy
Using the command ‘cat /etc/os-release’
cat /etc/os-release
:~/scripts$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.1 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.1 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
Summary:
- lsb_release -a
- cat /etc/os-release