To find out the name and version of your Linux distribution, you can try one of the following methods:
lsb_release
command: This command is part of the Linux Standard Base (LSB) utility, and it can be used to display information about the Linux distribution. To display the name and version of your Linux distribution, you can use the -a
flag:$ lsb_release -a Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal
/etc/os-release
file: This file is a standard file found in most Linux distributions, and it contains information about the distribution, including its name and version. To display the contents of this file, you can use the cat
command:$ cat /etc/os-release NAME="Ubuntu" VERSION="20.04.2 LTS (Focal Fossa)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 20.04.2 LTS" VERSION_ID="20.04" 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" VERSION_CODENAME=focal UBUNTU_CODENAME=focal
uname
command: This command can be used to display various information about the Linux kernel and the system it is running on. To display the name and version of the Linux distribution, you can use the -o
flag:$ uname -o GNU/Linux
Note that these methods may not work on all Linux distributions, as the information about the distribution may be stored in different locations or in different formats. However, these methods should work on most mainstream distributions.