5331 private links
The preferred method to check your Debian version is to use the lsb_release utility which displays LSB (Linux Standard Base) information about the Linux distribution. This method will work no matter which desktop environment or Debian version you are running.
lsb_release -a
Checking Debian Version using the /etc/issue file
The following cat command will display the contents of the /etc/issue which contains a system identification text:
cat /etc/issue
Checking Debian Version using the /etc/os-release file
/etc/os-release is a file which contains operating system identification data, and can be found only on the newer Debian distributions running systemd.
This method will work only if you have Debian 9 or newer:
cat /etc/os-release
Checking Debian Version using the hostnamectl command
hostnamectl is a command that allows you to set the hostname but you can also use it to check your Debian version.
This command will work only on Debian 9 or newer versions:
hostnamectl